Paypal have CUSTOM param in its API... I want multi-dimension array pass in CUSTOM field...
<form id="paypal_form" action="https://sandbox.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="user#paypal.com">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Hot Sauce-12 oz. Bottle">
<input type="hidden" name="amount" value="10">
<input type="hidden" name="currency_code" value="USD">
<!-- Prompt buyers to enter their desired quantities. -->
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="notify_url" value="http://www.myurl.com" />
<!-- Display the payment button. -->
<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online" />
<input type="hidden" value="1" name="custom[]" />
<input type="hidden" value="11" name="custom[]" />
</form>
its working fine with single custom field but multi custom field is not working...
you should pass all values like 1,2,3,4,5,6....
return url you will get custom string and convert it to array of string
Related
I have a standard Paypal button like this:
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="info#mywebsite.com">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name_1" value="My item Name 1">
<input type="hidden" name="amount_1" value="1000">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="item_name_2" value="My item Name 2">
<input type="hidden" name="amount_2" value="20">
<input type="hidden" name="quantity_2" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="notify_url" value="http://www.mywebsite.com/ipn-settings">
<input type="hidden" name="return" value="http://www.mywebsite.com/DEV/grazie/">
<input type="hidden" name="custom" value="24">
<!-- Display the payment button. -->
<input type="image" src="https://www.paypalobjects.com/it_IT/IT/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal รจ il metodo rapido e sicuro per pagare e farsi pagare online.">
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>
On click it redirects me to the PayPal page but the description and the price field are empty. Only the quantity is set to 1 and is readonly. Is there something wrong with this button?
Thanks in advance for your help.
I had to change the cmd value to "_cart" and add the hidden input "upload" with value = 1
Now it works fine!
My paypal payment completed successfully but after payment,I don't get transaction detail like transaction id, currency, price, item,receipt no etc...
before 15 days its working properly. but now its not working.
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-
bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="kin#kinskards.com">
<!-- Specify a PayPal Shopping Cart Add to Cart button. -->
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Birthday - Cake and
Candle">
<input type="hidden" name="amount" value="3.95">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="cancel_return"
value="http://localhost/PayPalDemo/PayPalDemoCancel.php">
<input type="hidden" name="return"
value="http://localhost/PayPalDemo/PayPalDemo/Succes.php">
<!-- Display the payment button. -->
<input type="image" name="submit"
src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_addtocart_120x26.png"
alt="Add to Cart">
<img alt="" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>
You must pass notify_url parameter like cancel_return.
<input type="hidden" name="notify_url" value="http://localhost/PayPalDemo/PayPalDemoPayment.php" />
Also you must set this URL in sandbox account in IPN section. Refer this https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSimulator/
I am using PayPal Standard HTML form, and after the user has completed the transaction he/she is taken to the return url. I want to be able to identify the user email, the order number, and other information that may be available using php. In other words, I want to use the GET method to retrieve the variables in the URL
This is a recurring payment (subscription), and below is the html code.
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="info#merchant.com">
<input type="hidden" name="return" value="test">
<!-- Specify a Subscribe button. -->
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<!-- Identify the subscription. -->
<input id="paymentName" type="hidden" name="item_name" value="test">
<input type="hidden" name="item_number" value="1234">
<!-- Set the terms of the regular subscription. -->
<input type="hidden" name="currency_code" value="CAD">
<input id="paymentPrice" type="hidden" name="a3" value="0.01">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<!-- Set recurring payments until canceled. -->
<input type="hidden" name="src" value="1">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0" style="width:240px; border: none; height:50px"
src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-large.png"
alt="PayPal - The safer, easier way to pay online">
</form>
As others already commented. You should use Instant Payment Notification (IPN).
documentation
Basically you need to set in your html form a field called "notifyurl", something like this:
<input type="hidden" name="notifyurl"alue="http://www.example.com/ipn_listener.php">
For the ipn_listener.php you have sample code here (if PHP):
Sample code for PHP
If you need to attach some specif information to the payment you can also use the paremeter "custom", and read it back in you ipn listener.
Here is my code. I need to add some extra variables example: license-type:Basic
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="business#email.com">
<!-- Specify a Subscribe button. -->
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<!-- Identify the subscription. -->
<input type="hidden" name="item_name" value="Alice's Monthly Digest">
<input type="hidden" name="item_number" value="DIG Weekly">
<!-- Set the terms of the recurring payments. -->
<input type="hidden" name="a3" value="69.95">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<!-- Set recurring payments to stop after 6 billing cycles. -->
<input type="hidden" name="src" value="1">
<input type="hidden" name="srt" value="6">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
How to add extra field in this methods ? or I need next line in description tab.!!
This is an example
https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_xclick_options_help_outside
Add this:
<input type="hidden" name="custom_input" value="Custom value" />
Please add this:
<input type="hidden" name="custom" value="your custom value">
this is an answer..!!!
<input type="hidden" name="item_name" value="INDIANJOBTIPS">
<input type="hidden" name="on0" value="Duration">
<input type="hidden" name="os0 " value="1 year">
<input type="hidden" name="on1" value="No of users">
<input type="hidden" name="os1 " value="1">
I'm trying to set up a button that offers buyers the option of inserting multiples
of an item and forces them to enter a shipping address here's the code:
<form action="<?php echo($paypal_url); ?>" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="<?php echo($paypal_email_address); ?>">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="<?php echo($item_name3); ?>">
<input type="hidden" name="amount" value="<?php echo($item_price3); ?>">
<input type="hidden" name="currency_code" value="<?php echo($item_currency3); ?>">
<input type="hidden" name="custom" value="<?php echo($mask); ?>">
<input type="hidden" name="undefined_quantity" value="1">
<input type="hidden" name="return" value="<?php echo($paypal_return); ?>">
<input type="hidden" name="notify_url"value="http://www.mywebsite.co.uk/ipn2.php">
<input type="hidden" name="cancel_return" value="<?php echo($cancel_return); ?>">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="2">
<!-- Display the payment button. -->
<input type="image" src="/img/PocketMask.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online." />
I'm in the process of testing it in the sandbox and the quantity option works fine but there doesn't appear to be an option for shipping address, if anyone could help me with this I'd really appreciate it.
The no_shipping variable determines whether or not you receive the shipping address with the transaction details after a payment completes. There isn't a shipping address field that would appear on the checkout page. The buyer would need to log into their account to select the shipping address to use to complete the payment.