I'm trying to integrate Paypal payments on website and I got this form:
<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" id="paypal_form">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="mail#mail.com" />
<input type="hidden" name="item_name" value="Test payment" />
<input type="hidden" name="item_number" value="777" />
<input type="hidden" name="amount" value="1.99" />
<input type="hidden" name="return" value="http://myhost.com//successpaypal.php" />
<input type="hidden" name="cancel_return" value="http://myhost.com/cancelpaypal.php" />
<input type="hidden" name="no_shipping" value="0" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="currency_code" value="USD" />
<input type="submit" value="Go to PayPal" />
</form>
And payments goes fine until users needs to confirm payment. There is no e-mail sending. I was trying in the sandbox with couple e-mail from couple computers and a couple of days. Is there any way to remove confirmation of payment by e-mail or what can be wrong with my that form?
The sandbox environment doesn't send emails externally. Since anyone can open (and confirm) any email address on any account in sandbox, it would be total chaos.
Instead, you can find all relevant messages that otherwise would've been sent as emails under 'Dashboard' > 'Sandbox notifications' on https://developer.paypal.com/
Related
We are trying to integrate PayPal’s UK Payments Pro with the hosted payment page.
We have created a new sandbox UK business account and a UK customer account.
Each time we attempt to make a payment, we get this error:
This transaction can't be processed. Please pay with another card.
Here is the HTML for our POST:
<iframe name="hss_iframe" width="570px" height="540px"></iframe>
<form style="display:none" target="hss_iframe" name="form_iframe" id="form_iframe" method="post" action="https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess">
<input type="hidden" name="buyer_email" value="nata#print-science.com">
<input type="hidden" name="last_name" value="dulger">
<input type="hidden" name="first_name" value="nata">
<input type="hidden" name="notify_url" value="http://xyzprinting.he18.printscience.net/paypalprohostedipn">
<input type="hidden" name="subtotal" value="21.03">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="cancel_return" value="http://xyzprinting.he18.printscience.net/paypal_cancel_2014?order=325558RL">
<input type="hidden" name="return" value="http://xyzprinting.he18.printscience.net/paypal_successful">
<input type="hidden" name="paymentaction" value="sale" />
<input type="hidden" name="template" value="templateD" />
<input type="hidden" name="business" value="ps-uk#printscience.com" />
<input type="hidden" name="cmd" value="_hosted-payment" />
<input type="hidden" name="address1" value="123 Cheapside">
<input type="hidden" name="city" value="London">
<input type="hidden" name="state" value="London">
<input type="hidden" name="zip" value="EC2 R 8AH">
<input type="hidden" name="custom" value="325558RL">
</form>
<script type="text/javascript">
document.form_iframe.submit();
</script>
Try changing the business value to the Secure Merchant ID value that is specified at the top of the Profile page of the Sandbox Test Site. The field should contain something like:
name="business" value="HNZ3QZMCPBAAA"
See the developer guide, p.64: https://www.paypalobjects.com/webstatic/en_GB/developer/docs/pdf/hostedsolution_uk.pdf
I'm trying to use Paypal IPNs on the sandbox. I have a form that submits an express checkout:
<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="my-sandbox-merchant-account#test.com" />
<input type="hidden" name="item_name" value="Item 3" />
<input type="hidden" name="item_number" value="3" />
<input type="hidden" name="amount" value="5.00" />
<input type="hidden" name="shipping" value="0.00" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="cn" value="Comments" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="lc" value="GB" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input type="hidden" name="test_ipn" value="1" />
<input type="hidden" name="return" value="http://myhost/my-return-url" />
<input type="hidden" name="rm" value="2" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>
The payment goes through fine with my sandbox buyer account, however the IPN notifications are failing. When I click on the IPN messages in the sandbox I see that the correct notification endpoint is configured, however the message has failed, the http response code is blank, and IPN typeTransaction = "made". My logs show that my IPN endpoint hasn't received any messages (I know the endpoint is up because i've tried sending a manual POST). The message paypal is trying to send is:
handling_amount=0.00&payer_id=442H4KP3WRC9E&ipn_track_id=989ff3ead6a80&shipping=0.00
&charset=windows-1252&payment_gross=
&verify_sign=ABKgD9bUbQF9WahZwd8aOs6tdcUGAteKcEga-DtOd5oNAkSSSLAh33xt
&item_name=Item 3&test_ipn=1&txn_type=web_accept
&receiver_id=4W89DC8YDWBUG&payment_fee=&mc_currency=GBP&transaction_subject=
&custom=&protection_eligibility=Ineligible&payer_status=verified
&first_name=atest&mc_gross=5.00&payment_date=14:46:44 Aug 05, 2013 PDT
&payment_status=Completed&quantity=1&my-sandbox-merchant-account#test.com
&item_number=3&last_name=buyer&txn_id=91L22343JY671341E&mc_fee=0.40
&resend=true&payment_type=instant¬ify_version=3.7&payer_email=a-test#buyer.com
&receiver_email=my-sandbox-merchant-account#test.com&tax=0.00&residence_country=US
I've tried resending the IPN multiple times, and have also tried the IPN simulator too but this just spins until the connection resets. Is this a problem with Paypal's sandbox IPN system, or have I forgotten something/am sending the wrong data on my form submit?
If it's a problem with the sandbox IPN messaging system, what other options do I have for testing aside from on live?
As above, the solution was to use standard ports (80/443) rather than non-standard 8080/8443
I'm having an issue with the paypal button code below not working when sent to a Hotmail address. It shows in the email source code and in the email message just fine. But when you click on it, it directs you to the paypal homepage.
This works fine in gmail and yahoo mail emails, but not Hotmail. The code below is what is used and how it appears in the emails.
Is there a reason why it's doing this, I can't find anything on it.
<form method="post" name="paypal_form" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="business" value="email#email.com"/>
<input type="hidden" name="invoice" value="NGQ2YWY1Nz000mZiYmEty1I2ZTMzZTcwOxxzMmI4Y="/>
<input type="hidden" name="item_name" value="Acme Company [testes]"/>
<input type="hidden" name="amount" value="4"/>
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="notify_url" value="http://site.com/paypal.php?payment_status=ipn"/>
<input type="hidden" name="cancel_return" value="http://site.com/paypal.php?payment_status=cancel"/>
<input type="hidden" name="return" value="http://site.com/paypal.php?payment_status=success"/>
<input type="hidden" name="upload" value="0"/>
<input type="image" src="http://site.com/images/paypal_logo.png" width="197" height="48" class="paypal_button" name="submit" alt="Make payments with PayPal!" title="Make payments with PayPal!">
</form>
You should never use a <form> in emails -- never, ever. It cannot be trusted to work.
What is generating this <form> with POST variables for you, and why is it not using an <a> link with GET variables instead?
I have just began working on a project processing paypal payment on a web site, which does not work fine in the sense that the email notification is sent if and only if the user goes back to the site. The fact is that I didn't code it and I even don't know what kind of api it uses. I read the doc which is quite obscure to me (It understood there is a token needs to be sent from the site by get request method but I am really not sure). I understand from the code that, in the following, the op=dodons uri is used to mange the response of paypal and to send an email notification to the user. Here is the only thing I can tell you about the page from which I want to fetch up how the payment is processed :
<form action="{$payPalURL}" method="post" class="payPalForm" id="frmpp">
<input type="hidden" name="cmd" value="_donations" id="typedon"/>
<input type="hidden" name="item_name" value="Donation" />
<input type="hidden" name="business" value="{$myPayPalEmail}" />
<input type="hidden" name="notify_url" value="{$url}/index.php?op=dodons&donation=1&tid={$randomID}&payment=1" />
<input type="hidden" name="return" value="{$url}index.php?page=campaign&op=dodons&campaign_id={$campaign->getId()}&don=ok" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="cbt" value="Continue" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="txn_id" value="{$randomID}" />
<input type="hidden" name="tid" value="{$randomID}" />
{if $logged_user != null}
<input type="hidden" name="a_id" value="{$logged_user->getId()}" />
</form>
It looks like you're using Payments Standard in combination with Payment Data Transfer (PDT).
PDT only works if the user makes it back to the site which is never guaranteed, even with Auto-Return enabled.
Instead, use Instant Payment Notification (IPN). This is a simple POST of all transaction data to a listener script on your server, and this happens regardless of whether or not the user makes it back to your site or not. It's completely separate from the checkout flow.
what's the best way to simply get feedback from PayPal to confirm that your customer paid? It looks as if the answer is IPN - if so, my followup question is, can I enable IPN for only specific buttons? I don't want PayPal pinging my IPN listener for purchases that don't require any kind of IPN integration.
I'm all about Agile and YAGNI, and therefore I don't want to do anything that is unnecessary.
You should read the IPN Documentation that have provided by PayPal. To use IPN, the simple way is to have invoice id for a transaction that you want to track. In the IPN listener page, you will get ipn_data and one of the field is the invoice. Using this id, you should get the data from your own transaction database, then change the status to reflect the payment status in PayPal.
In my code, usually I set status to unpaid, direct the user to paypal to do payment, and in IPN listener I will set the status to paid.
PayPal provide sample code so you can start right away. You can also see other PayPal documentation in this page.
You can easily include which IPN listener to use for in a button's parameters.
If you don't have a default location set on PayPal's website, then your IPN listener will only get pinged for those buttons that do have one set.
The PayPal form variable in question is "notify_url".
Here's an example subscription button, same variable for anything else though.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-butcc-subscribe.gif"
border="0" name="submit" alt="PayPal - The safer, easier way to pay online."
onclick="_gaq.push(['_trackEvent', 'Click', 'PayPalMonthSub', 'SubscribePage']);" />
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1"
height="1" />
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="paypal#yourdomain.com" />
<input type="hidden" name="item_name" value=" Monthly Subscription" />
<input type="hidden" name="item_number" value="1" />
<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="lc" value="GB" />
<input type="hidden" name="bn" value="PP-SubscriptionsBF" />
<input type="hidden" name="a3" value="4.99" />
<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="return" value="http://yourdomain.com/subscribe/thanks.aspx" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="cancel_return" value="http://yourdomain.com/subscribe" />
<input type="hidden" name="notify_url" value="/http://yourdomain.com/IPN.aspx" />
</form>
If you need the default notification url set on your account then you will only be able to stop your handler being pinged by including a different handler in buttons that don't need it. If PayPal doesn't get an HTTP200 from a handler though it will keep trying it so I wouldn't advise setting anything to a non existent URI.