I have been struggling with this issue for quite a while now. I am trying to test a PayPal button implementation with their Sandbox, and have the following code:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="email#example.com">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="Item Name">
<input type="hidden" name="no_note" value="1">
<input type="hidden" value="http://XX.XX.XX.XX" name="return">
<input type="hidden" name="src" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribe_LG.gif:NonHostedGuest">
<table>
<tr><td><input type="hidden" name="on1" value="First">First Name</td></tr><tr><td><input type="text" name="os1" maxlength="200"></td></tr>
<tr><td><input type="hidden" name="on2" value="Last">Last Name</td></tr><tr><td><input type="password" name="os2" maxlength="200"></td></tr>
<tr><td><input type="hidden" name="on0" value="Frequency">Frequency</td></tr><tr><td><select name="os0">
<option value="Weekly">Weekly : £10.00 GBP - weekly</option>
<option value="Monthly">Monthly : £25.00 GBP - monthly</option>
<option value="Yearly">Yearly : £250.00 GBP - yearly</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="option_select0" value="Weekly">
<input type="hidden" name="option_amount0" value="10.00">
<input type="hidden" name="option_period0" value="W">
<input type="hidden" name="option_frequency0" value="1">
<input type="hidden" name="option_select1" value="Monthly">
<input type="hidden" name="option_amount1" value="25.00">
<input type="hidden" name="option_period1" value="M">
<input type="hidden" name="option_frequency1" value="1">
<input type="hidden" name="option_select2" value="Yearly">
<input type="hidden" name="option_amount2" value="250.00">
<input type="hidden" name="option_period2" value="Y">
<input type="hidden" name="option_frequency2" value="1">
<input type="hidden" name="option_index" value="0">
<span id='signupButton'></span>
</form>
This successfully redirects me to the PayPal checkout, but once logged in with my Sandbox buyer account, it produces the following problem consistently:
I've done everything suggested in the error page, but still no luck. Am I missing something?
This is a generic (and ancient) PayPal "our process died attempting to produce a web page" error. Presumably you have some incorrect input or unusual circumstance that causes the crash, but you would be doing everyone a favor if you report this bug to PayPal so that they can fix it (to give a useful error back rather than crashing).
That said, to diagnose I would recommend stripping down to a super-simple button and if that works, try re-introducing the complexity of your button to see what triggers the crash.
However, since the crash happens after login it may also be a bad buyer account (or even a bad seller/buyer account combination) or some such that triggers the edge condition. So I would also try with a different buyer account.
Related
I implemented a Paypal HTML button (payment and subscription) to direct the client to the Paypal site to make a payment. Also, I pass the invoice # as a parameter. According to the following documents, invoice is a pass-through variable.
https://developer.paypal.com/docs/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/#
https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/archive/PP_subscriptions.pdf
In fact, I do receive all parameters (including invoice) as a POST call when testing on my sandbox account. However, when I test on live payments (non-sandbox account), the invoice is not received. However, I receive other payment information such as item_number, custom, transaction id, etc. Also, with live payments, the information is passed through a GET call instead of a POST call.
In summary, why do I receive the invoice parameter from sandbox payments but not with live payments.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="message">
<input type="hidden" name="return" value="<%= (request.isSecure() ? "https" : "http") + "://" + request.getServerName() + "/upgradepayment" %>">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="hosted_button_id" value="...">
<input type="hidden" name="business" value="...">
<input type="hidden" name="item_name" value="...">
<input type="hidden" name="notify_url" value="..."
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="a3" value="...">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="invoice" value="...">
<input type="hidden" name="custom" value="...">
<input type="hidden" name="item_number" value="...">
<input id="ok" type="submit" name="submit" value="Pay and Subscribe with PayPal" alt="PayPal - The safer, easier way to pay online" title="PayPal - The safer, easier way to pay online">
</form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="message">
<input type="hidden" value="<%= (request.isSecure() ? "https" : "http") + "://" + request.getServerName() + "/upgradepayment" %>" name="return">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="...">
<input type="hidden" name="item_name" value="...">
<input type="hidden" name="amount" value="...">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="CA">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="invoice" value="...">
<input type="hidden" name="custom" value="...">
<input type="hidden" name="item_number" value="...">
<input id="ok" type="submit" name="submit" value="Pay with PayPal" alt="PayPal - The safer, easier way to pay online" title="PayPal - The safer, easier way to pay online">
</form>
edit: I receive the information about subscriptions with instant payment notification (IPN)
I just did a live payment using this code below (your HTML but modified a bit):
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="message">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<BUSINESS_PAYPAL_EMAIL>">
<input type="hidden" name="item_name" value="<ITEM_NAME>">
<input type="hidden" name="notify_url" value="<CALLBACK_URL>"
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="invoice" value="<INVOICE_ID>">
<input type="hidden" name="custom" value="<CUSTOM_OPTIONAL>">
<input type="hidden" name="item_number" value="<ITEM_NUMBER>">
<input type="hidden" name="amount" value="<AMOUNT>">
<input id="ok" type="submit" name="submit" value="Pay and Subscribe with PayPal" alt="PayPal - The safer, easier way to pay online" title="PayPal - The safer, easier way to pay online">
</form>
I used https://requestbin.com/ to collect the IPN Callbacks. Here is the screenshot with the invoice:
Make sure you are correctly implementing IPN listener request-response flow.
Your listener should return an empty 200 message back to Paypal to these addresses;
https://ipnpb.sandbox.paypal.com/cgi-bin/webscr (for Sandbox IPNs)
https://ipnpb.paypal.com/cgi-bin/webscr (for live IPNs)
After that you get a VERIFIED message along with parameters.
Make sure to include invoice input (which seems like you already did) in the form.
The invoice is optional and is not passed back to you by default.
There is also an IPN simulator which you can try and make sure your listener is working correctly.
Here is a complete example on how to process IPN messages:
https://gist.github.com/xcommerce-gists/3440401
We integrated Paypal button to support our starting business. We received several user feedbacks about not being able to complete payment. They reported that they can see the payment page after clicking the Buy Now button. However they tried pay through Paypal account, pay with credit card and pay with Paypal credit. None of them work. However, no one in our team has faced such problem when checking out. So we really don't have an idea about what's going on. Here is an example Paypal button code we use:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="business#myticket.com">
<input type="hidden" name="env" value="www">
<input type="hidden" name="address_override" value="0">
<input type="hidden" name="item_name_1" value="演唱会">
<input type="hidden" name="amount_1" value="122">
<input type="hidden" name="discount_rate_1" value="10">
<input type="hidden" name="item_name_2" value="演唱会">
<input type="hidden" name="amount_2" value="122">
<input type="hidden" name="discount_rate_2" value="10">
<input type="hidden" name="shipping_1" value="$27.95">
<!-- Fill full name in the first_name field -->
<input type="hidden" name="first_name" value="Bruce Lee">
<input type="hidden" name="notify_url" value="https://www.myticket.com/payment/ipn">
<input type="hidden" name="address1" value="">
<input type="hidden" name="address2" value="">
<input type="hidden" name="city" value="">
<input type="hidden" name="state" value="">
<input type="hidden" name="zip" value="">
<input type="hidden" name="country" value="US">
<input type="hidden" name="email" value="">
<input type="hidden" name="custom" value="lmIvjDuZVRsCWFPDdfFsrKiNVrnAbWeTZSINiDuszZEGKjeXfhqxyqRrn">
<input type="hidden" name="paymentaction" value="authorization">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="return" value="https://www.myticket.com">
<input type="hidden" name="cancel_return" value="https://www.myticket.com">
<input type="image" name="submit" border="0" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-large.png" alt="Check out with PayPal">
</form>
Is there any problem with this Paypal button? If not, what else could be causing the payment to fail?
Besides, is there a way we can get a message about these failures? Right now we are using IPN. However IPN doesn't seem to notify us about these payment failures.
BTW, myticket.com is a fake url in this post.
Well first, when using Website Payments Standard buttons, you don't get much back as far as the declines. Typically you are only going to get details of declines back when you are using API calls to process the payment. As for the button itself, it looks fine to me. Perhaps some of the issue is with the special characters for the item name which is leading to the failure. You could try creating 2 of the same buttons/items but without the special characters and see if those same buyers run into the issue with the second button that they did with the first one. You could also try using the "lc" variable in your button code to see if this helps. You can see the description of what the "lc" variable does here.
I need to collect information about our high school reunion attendees and allow them to pay via a PayPal button. I've created the PayPal Pay Now button, but not sure what if any information will be collected and sent back to me. Do I need a separate form to collect information or is there a way to make the PayPal button work as the submit button for the data I collect using a form?
You should use a IPN (Instant Payment Notification) for this. There are lots of good templates for this available on GitHub. Your form might look like this:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="business" value="YOUR PAYPAL ID">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="item_name" value="ITEM_NAME">
<input type="hidden" name="item_number" value="ITEM_NUMBER>
<input type="hidden" name="amount" value="TOTAL_AMOUNT">
<input type="hidden" name="custom" value="<?php echo $attendee_id ?>">
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cbt" value="Return to website">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="return" value="http://domain.com/success.php"/>
<input type="hidden" name="notify_url" value="http://domain.com/ipn.php"/>
<input type="hidden" name="cancel_return" value="http://domain.com/canceled.php"/>
<button type="submit">Pay using PayPal</button>
</form>
when I run an ipn test everything works great. The data gets logged into the database as I planned it.. However when I purchase a product via. the sandbox:
money transfered
money accepted
I don´t get any ipn
The form code I use:
<div class="panel-footer">
<form class="btn-block" name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="paypal#**.com">
<input type="hidden" name="item_name" value="product name">
<input type="hidden" name="item_number" value="3500">
<input type="hidden" name="amount" value="50">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="custom" value="<?php echo $sponsored_data[$key]['user_id']; ?>::bteam::50::3500">
<input type="hidden" name="notify_url" value="http://**.com/paypal/ipn.html">
<input type="hidden" name="return" value="http://**.com/sponsor.html">
<input type="hidden" name="shopping_url" value="http://**.com/sponsor.html">
<button type="submit" class="btn btn-lg btn-block btn-default">BUY NOW!</button>
</form>
</div>
As I said, if I run the test on this adress it works fine: http://**.com/sponsor.html
Is the sandbox test not sending any ipn or did I do something wrong ?
I have the following payment form:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="online-store-paypal">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="kae#kvsites.ie">
<input type="hidden" name="item_name" value="Purchase made from www.kvsites.ie">
<input type="hidden" name="item_number" value="6">
<input type="hidden" name="amount" value="1.00">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" value="http://www.kvsites.ie/contact-us/Login?onlinestore_iid=6" name="return">
<input type="hidden" name="notify_url" value="http://www.kvsites.ie/ww.plugins/online-store/verify/paypal.php">
<input type="hidden" name="bn" value="IC_Sample">
<input type="image" style="width:68px;height:23px;" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" name="submit" alt="Make payments with payPal - it's fast, free and secure!">
<img width="1" height="1" alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif">
</form>
The relevant line is this:
<input type="hidden" name="notify_url" value="http://www.kvsites.ie/ww.plugins/online-store/verify/paypal.php">
When I access it directly, it (obviously) is registered in my web server's access log.
When I actually /use/ the form, though, the payment goes through successfully, but the IPN does not appear in PayPal's IPN history page, and does not appear in Apache's logs.
This is something that worked perfectly for months, and only recently has stopped working completely.
Paypal IPN notification are down at the moment. See on Twitter.