I am using PayPal Website Payment Standard with IPN enabled.
Before I was setting cmd variable like this
<input type="hidden" name="cmd" value="_xclick">
but then I canged it to
<input type="hidden" name="cmd" value="_cart">
Also I changed some other variables inside my form
<input type="hidden" name="item_name_1" value="Item1">
<input type="hidden" name="amount_1" value="2">
<input type="hidden" name="item_name_2" value="Item2">
<input type="hidden" name="amount_2" value="2">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="quantity_2" value="2">
<input type="hidden" name="item_number_1" value="121">
<input type="hidden" name="item_number_2" value="122">
But when the form is Posted to PayPal I am getting this error.
Thanks in Advance...
did you add target="paypal" in the form opening tag?
could you show the entire form?
I think that you have to include the upload variable to identify the form as a cart:
<input type="hidden" name="upload" value="1">
Related
I am trying to create simple PayPal button who pass amount and quantity details to PayPal. I am unable to pass hardcore amount in PayPal. I am expecting to show result like this:
Expected output
Problem is that my amount is not transferring to PayPal. Please support to resolve. Here is my code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" amount="1.0">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="hmmdmlk#gmail.com">
<input type="hidden" name="item_name_1" value="Item #1">
<input type="hidden" name="amount_1" value="1.00">
<input type="submit" value="PayPal">
</form>
When using _xclick, which is for operations on a single item, you want:
<input type="hidden" name="item_name" value="The item name.">
<input type="hidden" name="amount" value="1.00">
The multi-item parameters you were using would be for _cart with upload=1, not _xclick
Documentation: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/
I am using the PayPal IPN System which works perfectly in sandbox mode. All the payments went through successfully and my site updated as required. So, being ready to go live, I change my sandbox links to live links:
$action = 'https://www.paypal.com/cgi-bin/webscr';
But now, whenever the payment form is posted to this address, it ends up at
https://www.paypal.com/webapps/hermes?token=...
which just shows a blank page. No error_log is created on my server.
Here is my form data before the link to PayPal is clicked.
<form name="frm_payment_method" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="business" value="payments#domain.com">
<input type="hidden" name="notify_url" value="http://domain.com/ipn.php">
<input type="hidden" name="cancel_return" value="http://domain.com/cancelled.php">
<input type="hidden" name="return" value="http://domain.com/success.php">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="lc" value="">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="page_style" value="paypal">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="item_name" value="1 Credit">
<input type="hidden" value="_xclick" name="cmd">
<input type="hidden" name="amount" value="1.50">
<p><button type="submit" name="submit" class="btn btn-primary">Proceed to PayPal</button>
Cancel</p></form>
Of course, replacing domain.com with my own correct domains.
I am trying to make a paypal payment and I have a problem when returning to my page after the payment is completed.
I want to do it dynamically (so I do not want to set it in the paypal's account option, as I may use this account for other things). This is the form I send to paypal:
<form id="paypalForm" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="notify_url" value="http://zopomobile.es/pruebas/modules/rmaforsat/ipn_paypal.php">
<input type="hidden" name="item_name_1" value="Pago de su orden a Zopomobile.">
<input type="hidden" name="item_number_1" value="1">
<input type="hidden" name="amount_1" value="259.12">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="custom" value="152">
<input type="hidden" name="business" value="admin-facilitator#zopomovil.es">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="return" value="http://zopomobile.es/pruebas">
<input type="hidden" name="cancel" value="http://zopomobile.es/pruebas/NO">
<input type="hidden" name="rm" value="2">
</form>
I have tried changing the "return" variable to "return_url", still not working.
If you want to automatically re-direct to "http://www.zopomobile.es/pruebas/"
then you need to turn on "Auto Return" on your PayPal profile.
Right now, Auto Return is "OFF" in your profile.
The return parameter is return
https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_profile-website-payments
Check above link to turn on the "Auto Return" feature.
I am trying send a PayPal multiple items with quantity and amount in a shopping cart. When i try to send the following i get a unknown error. i dont know why
<form name="check_out_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="sales#ss.com"/>
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="item_number_1" value="1"/>
<input type="hidden" name="item_name_1" value="Featured: 3"/>
<input type="hidden" name="amount_1" value="9.95"/>
<input type="hidden" name="quantity_1" value="3"/>
<input type="hidden" name="item_number_2" value="2"/>
<input type="hidden" name="item_name_2" value="Standard: 2"/>
<input type="hidden" name="amount_2" value="2.95"/>
<input type="hidden" name="quantity_2" value="2"/>
<input type="hidden" name="page_style" value="Career"/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="no_shipping" value="1"/>
<input type="hidden" name="return" value="http://www.sss.com/welcome.php?id=success"/>
<input type="hidden" name="return_cancel" value="http://www.sss.com/welcome.php"/>
<input type="hidden" name="custom" value="id|1-custom|1-fea|9.95|3|29.85-std|2.95|2|5.9-total|"/>
<input type="hidden" name="notify_url" value="http://www.sss.com/ipn.php"/>
<input type="hidden" name="cbt" value="Complete Upgrade">
<input type="submit" name="button" id="button" value="Pay now"/>
</form>
I cant figure out what i am doing wrong here i get error saying
"We have detected a problem with this shopping cart. If the problem persists, please contact the merchant. At this time, we are unable to process your request. Please return to xxl and try another option."
Add a new variable called "upload", so it might look like:
...
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
...
Tried it, worked with your code in my PP-Sandbox.
I am using this code to create my subscription for PayPal.
But it is not recognizing any of my input fields. Would you be able to shed some light on why not?
<form method="POST" name="gateway_form" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="business" value="EMAIL"/>
<input type="hidden" name="currency_code" value="CAD"/>
<input type="hidden" name="return" value="http://www.URL.com/payment/paypal_success.php"/>
<input type="hidden" name="cancel_return" value="http://www.URL.com/payment/paypal_failure.php"/>
<input type="hidden" name="notify_url" value="http://www.URL.com/payment/paypal_ipn.php"/>
<input type="hidden" name="item_name" value="Monthly Subscription"/>
<input type="hidden" name="discount_amount" value="0.00"/>
<input type="hidden" name="a3" value="49.00"/>
<input type="hidden" name="t3" value="M"/>
<input type="hidden" name="p3" value="30"/>
<input type="hidden" name="src" value="1"/>
<input type="hidden" name="sra" value="1"/>
<input type="hidden" name="srt" value="1"/>
<input type="submit" value="Click Here"></p>
</form>
You need to tell PayPal who is submitting the request by submitting the required URL parameters user, pwd, version, and (recommended but optional) signature, along with the other parameters you're sending in the POST request. See API Overview.
Take a look at this link:
Subscriptions and Recurring Payments Variables
https://www.paypal.com/cgi-bin/webscr?cmd=p/acc/ipn-subscriptions-outside
Also, I suggest you use a hosted button. It makes the whole process very easy.
Well both you guys were right, but the issue that came about was because on my 3rd line there
<input type="hidden" name="cmd" value="_xclick"/>
needs to become
<input type="hidden" name="cmd" value="_xclick-subscriptions"/>
Thanks for your help!