I am using PayPal Payments Standard with my own button code as follows. This works exactly as I would like except for one thing. In the PayPal shopping cart and on the invoicing, the display shows "Shipping and Handling". In California, I have to pay taxes on Handling fees. Can I make the display show "Shipping" only without the "Handling?
I tried to pass both a "handling" and a "handling-cart" input attribute with both empty and zero as values but that had no impact.
<form target="paypal" action="<?=PAYPAL_URL?>" method="post">
<input type="hidden" name="business" value="<?=PAYPAL_BUSINESS?>">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="amount" value="12.50">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="shopping_url" value="<?=$url?>">
<input type="hidden" name="shipping" value="5.00" />
<input type="hidden" name="shipping2" value="5.00">
<input type="hidden" name="item_name" value="stain">
<input type="image" src="images/add_to_cart.png" border="0" name="submit" alt="Add to Cart">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Related
I am new to PHP , and PayPal.
I need to do crowdfunding site.
Here I have a form where user can choose pay method :
Pay with terminal
Bank transfer
Paypal
Input with amount that user want to donate for project, and some fields like name, surname , phone etc.
Now action of my form is example.com/pay.php, here I register pay in my database with status "in progress" and i want after it to redirect user to PayPal page.
How to redirect user to PayPal with necessary data (see in PayPal button code) , after I add the transaction to my database?
Code of of my PayPal button:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="BJKELCPG5WDSN">
<input type="hidden" name="lc" value="MD">
<input type="hidden" name="item_name" value="Help African child">
<input type="hidden" name="item_number" value="2299">
<input type="hidden" name="amount" value="67.00">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="http://example.com/test/thanks.php">
<input type="hidden" name="cancel_return" value="http://example.com/test/">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="hidden" name="notify_url" value="http://example.com/test/listener.php">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Help me please with this problem.
I have decided to use Paypal's Payment Gateway method that allows my customer to have the option to pay the amount fully or have an installment plan for them to pay for the things they ordered.
I'm aware that you can define variables before the creation of the Installment Plan button. However, the problem with this is that the variables are predefined.
What I'm looking for is if there's a way to change the value of these variables, how do I do so?
Here's my code for my cartbookout the page so far.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YQUKWHZVR23K8">
<table>
<tr><td><input type="hidden" name="on0" value="plan"></td></tr>
<tr><td><input type="hidden" name="os0" value ="option_0"></td><td>
<strong>Installment for Programme</strong></td></tr>
<tr><td></td><td>Number of payments 4</td></tr><tr><td></td><td>Start
payments At checkout</td></tr>
<tr><td></td><td>
<table>
<tr><th align="left">Due*</th><th align="right">Amount</th></tr>
<tr><td>At checkout</td><td align="right"><?php echo ($totalAmount/4) +
"SGD" ; ?></td></tr><tr><td>Every 1 month (x 3)</td><td align="right"><?php
echo ($totalAmount/4);?></td></tr><tr><td COLSPAN="2" ALIGN="right"><?php
echo $totalAmount ?></td></tr></table></td></tr>
<tr><td colspan="3"><i>* We calculate payments from the date of checkout.
</i></td></tr></table>
<table><tr><td align=center><i></i></td></tr><tr><td><input type="image"
src="https://www.paypalobjects.com/en_US/i/btn/btn_installment_plan_LG.gif"
border="0" name="submit" alt="PayPal - The safer, easier way to pay
online!"></td></tr></table>
<img alt="" border="0"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1"
height="1">
</form>
I've tried to look up this issue on StackOverflow, but they were asking mostly on Payment in Full but not an Installment Plan method. Also, I've tried their solutions but to no avail.
Any help would be appreciated.
With the installment plan you can choose different amounts and very the time period for repayment. Keep in mind that only 4 installments are allowed.
Providing a screen shot for a hosted button and the code for non hosted. Keep in mind we recommend you protect any non hosted buttons.
Installment plan information on the PayPal Developer site:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/installment_step_1/
Non Hosted Button Code below (currently pointing to the sandbox):
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-payment-plan">
<input type="hidden" name="business" value="youremail#email.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Test Installment Plan">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="disp_tot" value="Y">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-PaymentPlanBF:btn_installment_plan_LG.gif:NonHosted">
<table>
<tr><td><input type="hidden" name="on0" value="plan"></td></tr>
<tr><td><input type="hidden" name="os0" value ="option_0"></td><td><strong>Variable Installments</strong></td></tr>
<tr><td></td><tr><td></td><td>Number of payments 4</td></tr><tr><td></td><td>
<table>
<tr><th align="left">No.</th><th align="left">Due*</th><th align="right">Amount</th></tr>
<tr><td>1</td><td>At checkout</td>
<td align="right">$50.00 USD</td></tr><tr><td>2</td><td>after 1 week</td>
<td align="right">$75.00 USD</td></tr><tr><td>3</td><td>after 2 weeks</td>
<td align="right">$85.00 USD</td></tr><tr><td>4</td><td>after 3 weeks</td>
<td align="right">$90.00 USD</td></tr><tr><td COLSPAN="3" ALIGN="right">Total $300.00 USD</td></tr></table></td></tr>
<tr><td colspan="3"><i>* We calculate payments from the date of checkout.</i></td></tr></table>
<input type="hidden" name="option_select0" value="option_0">
<input type="hidden" name="option_select0_name" value="Variable Installments">
<input type="hidden" name="option_select0_type" value="V">
<input type="hidden" name="option_select0_a0" value="50.00">
<input type="hidden" name="option_select0_p0" value="0">
<input type="hidden" name="option_select0_t0" value="W">
<input type="hidden" name="option_select0_n0" value="1">
<input type="hidden" name="option_select0_a1" value="75.00">
<input type="hidden" name="option_select0_p1" value="1">
<input type="hidden" name="option_select0_t1" value="W">
<input type="hidden" name="option_select0_n1" value="1">
<input type="hidden" name="option_select0_a2" value="85.00">
<input type="hidden" name="option_select0_p2" value="2">
<input type="hidden" name="option_select0_t2" value="W">
<input type="hidden" name="option_select0_n2" value="1">
<input type="hidden" name="option_select0_a3" value="90.00">
<input type="hidden" name="option_select0_p3" value="3">
<input type="hidden" name="option_select0_t3" value="W">
<input type="hidden" name="option_select0_n3" value="1">
<input type="hidden" name="option_index" value="0">
<table><tr><td align=center><i>Sign up for</i></td></tr><tr><td><input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_installment_plan_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"></td></tr></table>
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Here is a screen shot for a hosted button:
Thanks,
Jennifer
Good morning!
I have an issue with my PayPal payment.
There is my PayPal form:
<form id="upsell_form_paypal" name="_xclick" action="https://www.paypal.com/it/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="admin#test.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="return" value="https://test.com/thank-you.php?type=upsell&payment=paypal">
<input type="hidden" id="upsell_notify_url" name="notify_url" value="https://test.com/payment.php?type=upsell">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="item_name" id="item_name" value="Upsell-1">
<input type="hidden" name="amount" id="paypal_amount" value="0.01"><!-- PRICE -->
<input type="hidden" name="custom" id="paypal_custom" value="170907265"><!-- DEAL ID-->
<input type="hidden" name="payment_type" id="paypal_type_1234565" value="upsell"><!-- DEAL ID-->
<input type="image" class="image" style="margin-top:0" src="https://www.test.com/wp-content/uploads/2016/08/pagadesso.gif" border="0" name="submit" alt="Pay via PayPal">
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
This array I get after payment. In my notify_url file, I can get all variable values except item_name. item_name is empty and I can't get it value.
What could it be? On Friday item_name working fine and I got its value, but from yesterday I can't get it anymore...
how to hide paypal button code from user ?
for example codecanyon.net when i purchase some item i don't see paypal form , how can i do that ?
my user will edit price and currency code
i use code look like this.
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="me#mybusiness.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Teddy Bear">
<input type="hidden" name="amount" value="12.99">
<input type="image" src="http://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="me#mybusiness.com">
<input type="text" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Teddy Bear">
<input type="text" name="amount" value="12.99">
<!-- for submit button -->
<input type="submit" name="submit" value="Pay now">
<!-- for image button -->
<input type="image" src="your button image url" border="0" name="submit" alt="Give here some title">
</form>
For currency you should use select box
<input type="text" name="currency_code" value="USD">
<select name="currency_code" >
<option value="USD">USD</option>
</select>
when you use the button tool to create a saved button all the sensitive data is stored in the account and is replaced by a "Button ID". Here's an example:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="L7NSNLBNU69AC">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Use:
<input type="image" src="your image url" border="0" name="submit" alt="Pay Now">
I have a paypal sandbox "Add to Cart" where if a user adds a particular product from a database into an account, it should display the price of that product based on what it is in the database.
Say I have these two products;
prodID: 1
product: Hat
price: £5.00
prodID: 2
product: socks
price: £3.00
however, when I add these products to cart in sandbox, its says they are £0.50 when they clearly are not. Here is my code;
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="7UCL9YCYYXL3J">
<input type="hidden" name="item_name" value="<?php echo $row['product']; ?>">
<input type="hidden" name="item_number" value="<?php echo $row['prodID']; ?>">
<input type="hidden" name="amount" value="<?php echo $row['price']; ?>">
<input type="hidden" name="currency_code" value="GBP">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
it seems this has the problem (i dont know how to handle the _s-xclick:
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="7UCL9YCYYXL3J">
instead, this has not:
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="youremail#yahoo.gr">