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.
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
I'm trying to integrate a Paypal Button but I'm getting error on sandbox while it looks working on production.
The code is:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> -->
<input type="hidden" name="business" value="email#accountonsandbox.local">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://return_url">
<input type="hidden" name="cancel_return" value="http://cancel_url">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="cbt" value="Back">
<input type="hidden" name="notify_url" value="http://notify_url">
<input type="hidden" name="custom" value="customdata">
<input type="hidden" name="item_name" value="item_name">
<input type="hidden" name="amount" value="6">
<input type="hidden" name="currency_code" value="EUR">
<img alt="" border="0" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
<input type="hidden" name="lc" value="it_IT">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0" width="140"
src="https://www.paypalobjects.com/webstatic/en_US/btn/btn_paynow_cc_144x47.png"
alt="Paga con PayPal">
</form>
If the first line is production, it works (I see paypal's page to make payment), if I switch with line 2 (sandbox) I'm getting an internal server error from paypal's server showing the error page.
This situation is going on by more than 10 days but I can't deploy it in production without test it.
Sandbox status shows that everything is working, I don't have idea how to solve this.
UPDATE
The error is: http://imgur.com/a/vF3wC
It's in italian, translating it should be something like: There was a system error. Try later.
I'm trying to get this form to initiate a donation using PayPal Payments Standard...
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="text" name="amount"></input>
<input type="hidden" name="item_name" value="OrganizationXYZ Donation">
<input type="hidden" name="image_url" value="http://www.OrganizationXYZ.org/images/logo.gif">
<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">
</form>
This seems like it should work according to PayPal's documentation, but it doesn't. Instead I get this error:
"We cannot process this transaction because there is a problem with the PayPal email address supplied by the seller. Please contact the seller to resolve the problem. If this payment is for an eBay listing, you can contact the seller via the "Ask Seller a Question" link on the listing page. When you have the correct email address, payment can be made at www.paypal.com."
This error doesn't make any sense because you do not supply an email address in these forms. Yet it seems to me that my form needs to post some kind of identification- otherwise how would PayPal know which account is receiving the donation? Unless I register a domain vai my PayPal account settings, but there is no place to do that either.
Does anybody have experience with setting this up?
Yes, as you mentioned, it need some sort of identifier of the recipient.
What you need to add is the 'business' parameter. That's all.
<input type="hidden" name="business" value="your secure merchant account ID / email here">
You must to have a merchant account.
You can see a tutorial here: http://kb.worldsecuresystems.com/833/cpsid_83331.html
try this code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<select name="amount">
<option value="3.99">6 Months ($3.99)</option>
<option value="5.99">12 Months ($5.99)</option>
</select>
<br>
<input name="currency_code" type="hidden" value="USD">
<input name="shipping" type="hidden" value="0.00">
<input name="tax" type="hidden" value="0.00">
<input name="return" type="hidden" value="urlOnValidPayment">
<input name="cancel_return" type="hidden" value="UrlOnCancelPayment">
<input name="notify_url" type="hidden" value="URLForValidationPayement">
<input name="cmd" type="hidden" value="_xclick">
<input name="business" type="hidden" value="your e-mail">
<input name="item_name" type="hidden" value="name of the object">
<input name="no_note" type="hidden" value="1">
<input type="hidden" name="no_shipping" value="1">
<input name="lc" type="hidden" value="EN">
<input name="bn" type="hidden" value="PP-BuyNowBF">
<input name="custom" type="hidden" value="custom data">
<input type="image" src="https://www.paypalobjects.com/en_US/CH/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/fr_FR/i/scr/pixel.gif" width="1" height="1">
</form>
for me it's work
¿Are you just generating the payment buton yourself?
I must recommend you to login to your PayPal account, go to this part of the menu:
Merchant Services -> Key Features -> Buy now Button
Then choose the button type I guess you want a Donate button.
Then configure the overall button settings, I must recommend to save the button in paypal servers.
Finally choose Create Button
This will give you the right HTML code. This is a sample donate button HTML.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="YOUR_BUSINESS_ID">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="myorgname">
<input type="hidden" name="item_number" value="donateid">
<input type="hidden" name="amount" value="20">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
<input type="hidden" name="custom_variable1" value="val1">
<input type="hidden" name="custom_variable2" value="val2">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_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>
Here is your problem:
<input type="hidden" name="cmd" value="_donations">
Paypal's image value in Encrypted Payment System (WPS - EPS) for "cmd" is "_s-xclick"
So use it as below:
<input type="hidden" name="cmd" value="_s-xclick">
I'm having some trouble implementing PayPal into a website. I haven't used it in a while and a lot of things have changed since.
The problem I'm having is that i specified clearly that users should not be prompted for their shipping address, however, when the "no paypal account" option is selected, the shipping info is anyways asked.
I know I should ask PayPal, but here people are smarter and kinder. =)
code:
note the: <input type="hidden" name="no_shipping" value="1">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="ventas#ziced.com">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Variables agregadas -->
<input type="hidden" name="notify_url" value="notify.php">
<input type="hidden" name="return" value="return.php">
<input type="hidden" name="cancel_return" value="cancel_return.php">
<input type="hidden" name="page_style" value="primary">
<input type="hidden" name="lc" value="EN">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Ziced id:">
<input type="hidden" name="amount" value="10">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="quantity" value="1">
<!-- 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">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
no_shipping=1 applies to the shipping address. What you're looking at for the buyer on the 'guest checkout form' is the billing address. That's always going to be required.
Here's a little more information for others:
<input type="hidden" name="no_shipping" value="0"> - prompt for shipping address, but do not require one
<input type="hidden" name="no_shipping" value="1"> - do not prompt for shipping address
<input type="hidden" name="no_shipping" value="2"> - prompt for shipping address, and require one
See also: Paypal Address Handling Guide
I am using Paypal buy now button on my website. For testing purpose I am using paypal sandbox account. The problem is when I click on buy now button, it takes me to sandbox sign in page when I have not already signed in. The following is my buy now button code
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="skariz_1316503728_biz#gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="PSYC">
<input type="hidden" name="amount" value="2.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="custom" value="test#test.com">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<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>
I believe the sandbox account buttons require you to log into your sandbox account to use it. If memory serves the last time I was working with an IPN I had to do that. There may also be a section where you create test customer sandbox accounts, but I can't recall.