I have the IPN receiver on my server successfully receiving IPNs and re-posting them back to PayPal's server (https://www.paypal.com/cgi-bin/webscr) for validation. I am testing it using the IPN simulator and it always receives INVALID. So I've done the bulk of the work and got the servers talking. There's just a bit of fine polishing needed and I cannot debug this because I have no feedback. Where can I get this feedback?
PayPal's docs state the following:
"Check your IPN history on paypal.com.
Your IPN history tells you whether PayPal sent a given IPN message and whether your listener responded to it. This page may also provide information about the status of the server on which your listener is running. If necessary, you can request that PayPal re-send a given IPN message via the IPN history page."
-- https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNTesting/
So I need to find this IPN history, right? But what account are these IPN logs recorded? Do they definitely include IPNs generated using the simulator? If not what's the point and how does any dev debug? I've looked in the live merchant account, the sandbox merchant account, the sandbox payer account. But they all say there is no history of any IPNs being sent.
Just a side point: PayPal's sandbox is a nightmare because if you log out of one sandbox account you find yourself at the login page back on the live site. Similarly, you cannot login to the IPN simulator using a sandbox merchant account, only the live merchant account so you are forever having to login as live merchant to send the request, logout, login as sandbox, check the IPN history, find nothing, log back out, log in as live and repeat until you are insane. Then to further confuse things, the simulator sends IPNs from the address buyer#paypalsandbox.com SO MAKE UP YOUR MIND PAYPAL!!!! Is the IPN Simulator part of the sandbox or not? Once you have submitted one simulated IPN, it resets all the form values to defaults if you do need to enter an address of a valid sandbox payer account (The docs don't state whether or not you do, but I am cluching at straws here) you also have to copy and paste into boxes numerous times per request. Please please please PayPal, write you docs in a way that can be understood by someone who is not one of your colleagues. Explain what environment you need to be in at each stage of testing the IPN.
I am feeling very frustrated because this is not how development should be done. I am blindly trying things based on hunches, very unscientific and very inefficient.
Can anyone clarify (or point me to the part of the docs that clarifies) exactly how to debug INVALID responses please?
OK. After some significant time I have come to the following conclusions:
The IPN Simulator is NOT really part of the sandbox. It is useful for hitting quick lightweight tests to check PayPal's server can talk to yours but that is about it. It is far from a true payment process simulator! The solution to debugging your IPN validation process is to start the payment simulation process from the basket submission stage with a few very important values set to sandbox environment.
1) Firstly, log in to https://developer.paypal.com/ using your LIVE business account username and password. Click on Applications > Sandbox Accounts https://developer.paypal.com/webapps/developer/applications/accounts and create 2 sandbox accounts:
Create one Merchant/Business Sandbox Account, this is going to be our fake shop. For example alansugar#yourdomain.example.com
Then, create one Personal Sandbox Account, this is going to be our fake customer. For example ladygaga#yourdomain.example.com
We are going to use this fake shop and this fake customer to play in the sandbox...
2) Set up the basket page on your server (the one that submits to PayPal) with your Merchant/Business Sandbox account's address in the business field and PayPal's sandbox domain in the action property of the FORM element. Like so...
<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" value="_xclick" name="cmd">
<input type="hidden" value="alansugar#yourdomain.example.com" name="business">
<input type="hidden" value="1" name="no_note">
<input type="hidden" value="GBP" name="currency_code">
<input type="hidden" value="GB" name="lc">
<input type="hidden" value="PP-BuyNowBF" name="bn">
<input type="hidden" value="bo14-9097200" name="invoice">
<input type="hidden" value="monkey" name="custom">
<input type="hidden" value="A nice pair of trousers" name="item_name">
<input type="hidden" value="1" name="Some socks to match">
<input type="hidden" value="25.0" name="amount">
<input type="hidden" value="2" name="no_shipping">
<input class="buyButton" type="image" border="0" alt="PayPal – The safer, easier way to pay online." name="submit" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif">
<img width="1" border="0" height="1" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" alt="">
</form>
3) Submit the basket and when you see the PayPal payment page (your browsers address bar will be accessing the www.sandbox.paypal.com domain) use your fake customer account to pay.
4) Log in to https://developer.paypal.com/ using your LIVE account. Click on Applications > Sandbox Accounts and click the Enter Sandbox site link. Now, whilst your browser is still logged into your main live account, you can kind of secondarily log in to a deeper layer using the sandbox accounts username and password (very confusing). Of course just to confuse you, the Username and Password boxes in the top right will be pre-populated with your live account's details. Wipe these and use the sandbox Merchant/Business account's username and password. Now click on History > IPN History and you can see the requests that were posted to your server. You should be able to debug nicely using this information. If IPN is not enabled on your Merchant/Business Sandbox Account yet it will give you instructions to go to a settings page and enable it. Do that. Obviously any payments before that point will not have triggered IPNs.
I hope this description helps anyone who, like me, found that the Official PayPal Docs read like a book with half the pages missing!
To access IPN notification history in PayPal sandbox, login at https://www.sandbox.paypal.com with your test merchant account.
Navigate to "My Account/Profile"
in "Selling preferences" section it has a link "Instant Payment Notification preferences"
On that page there is a link to "IPN History page".
I'm not sure if they recently have added this to the sandbox, but I agree it's pretty cumbersome.
Related
I've set up an order page with Add to Cart buttons and a standard View Cart function.
I've set up a buyer and seller account in sandbox.
I've tested the payment process and all works fine.
I then activated the Return URL option in my seller's profile payment options and entered the URL that I want to send the user to (which should then process the PDT and give the user some feedback).
I've of course entered the token generated after setting up Return URL in my
script.
However, once a transaction is done I get first a confirmation page from PayPal with a manual "go back to seller's page" link. And it then automatically redirects me to the sandbox home page (logged out). This also happens when clicking on the manual link to go back to the seller's page.
What am I not getting? I appreciate any help on this. Lost so much time with that already...
Thanks,
Sam
edit: adding these two lines to my form actually solved my problem:
<input type="hidden" name="return" value="your return url">
<input type="hidden" name="cancel_return" value="your cancel url">
I am building a simple paypal app, using a BuyNow button by inserting a code snippet in my website, I already registered my app in the paypal development site, as well as the test users, buyer and seller.
But my problem is when I submit my button, I am taken to paypal real payment view, and when I try to loggin with my virtual buyer credentials (user/passw) I receive a loggin fail, and when I try to use the credit card data of that virtual user, I dont have a cvv code, because it is not specified in the data provided by paypal in the sandbox account section.
I have read the whole paypal documentation several times, and most of topics in this forum, but I still have some doubts:
1- Which url to use to get the "sandbox payment view".
2- If such "sandbox payment view" doesn't exist and I just need to get the real payment view, why is the reason I can't login with the credentials paypal provided to my virtual buyer user?
3- If such "sandbox payment view" doesn't exist and I just need to get the real payment view, why Paypal doesn't provide me the cvv in the credit card data of my virtual user?
this is the code snippet I am using:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ASSIGNED VALUE HERE">
<input type="image" src="someImage.gif" border="0" name="submit">
<img alt="" border="0" src="otherImage.gif" width="1" height="1">
</form>
I think this is a basic doubt, and any help could be useful to others paypal beginners like me. Thanks in advanced.
You're using a hosted button here, so it won't be quite as simple as updating the URL to use the sandbox.
First, you need to make sure you've logged in to your PayPal developer account. There, if you haven't already, create at least 1 "seller" account and 1 "buyer" account.
Once you have accounts created in the sandbox you can then use those accounts to sign in at http://sandbox.paypal.com.
What you'll need to do is login to the sandbox using your seller account, and then go through the same process of creating that hosted button just like you did on the live account. That will give you back a snippet for a hosted button from that sandbox account, and then to test it you'll be able to login using your buyer account.
Once you have everything working the way you want and you're ready to go live just replace the entire snippet with your live version.
It's a little bit a pain working with hosted buttons because if you end up making adjustments to the settings on the button while playing with it in the sandbox you'll need to make those same adjustments with your button on the other side.
If you ever decide to start working with the web service API's instead of standard payments buttons working in the sandbox can be a lot more seamless.
I'm testing a simple paypal paying script whisch works fine except that it's not calling my notify_url and I don't understand why. The url is reachable and even the sandbox IPN testing gives a positive result. Even stranger, on the same domain I have an other script that is working briliantly. Code is not identical, but it's using the same method.
This is the html of the form used to send paymento to Paypal:
form id="ppcheckout" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" name="pp">
<input type="hidden" value="_xclick" name="cmd">
<input id="business" type="hidden" value="xxx#gmail.com" name="business">
<input id="currency_code" type="hidden" value="EUR" name="currency_code">
<input type="hidden" value="http://www.mydomain.com/dir/ipn.php" name="notify_url">
<input id="return" type="hidden" value="http://www.mydomain.com/dir/" name="return">
<input id="cancel_return" type="hidden" value="http://www.mydomain.com/dir/" name="cancel_return">
<input type="hidden" value="1" name="amount">
<input type="hidden" value="Order from mysite" name="item_name">
<input type="hidden" value="1" name="invoice">
</form>
Can't realy figure out what's wrong or missing. Does someone have an idea?
Thanks
Bye
I hope you are not testing paypal on LOCALHOST. That wont work, you need to test it online, in a web server, you can code using localhost but have to upload it to the SERVER so as to test it completely.
Here is a link that might help in configuring paypal - How to Set Up PayPal Integration with PHP & MySQL
You need to edit the Instant Payment Notification (IPN) settings in your PayPal Sandbox business account.
Log into Sandbox business account.
Go to the Profile page and click on Instant Payment Notification preferences link.
Set Notification URL and enable the IPN message.
Full tutorial can be found from here - PayPal IPN / Notify URL is not working on Sandbox Account
Have you verified your sandbox account's email?
This link sounds similar to your problem, and that fixed it for him.
Checked for Queued IPN messages.
Hover over your profile Icon ->
Account Settings ->
(on Left) Notifications ->
Instant Payment Notifications (Click Update) ->
Search for IPN History
Now check whether the messages are queued or failed etc. It well might be paypal sandbox encounter's spikes and can't deliver the messages.
This is a direct link to IPN History
I had a hard time getting the sandbox to work as well. I would try to test it on paypal and confirm that sandbox is not doing something goofy
I had the same issue my login check was creating problem when paypal hit back to notify_url. I passed user session id in notify_url as query string and every thing works fine for me. Paypal on localhost won't work.
Using below link you can download paypal IPN class
http://www.micahcarrick.com/php-paypal-ipn-integration-class.html
My client created a hosted Subscription button and gave me following code to apply in our website:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="X9Z9BHN867R2E">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
On Paypal's Checkout screen there are 2 options:
1) Already have PayPal account (2) Create PayPal account.
If I choose first option and enter a wrong username/password. Then I see a link: "Pay using your credit or debit card". When user clicks on this link, it just throws an error: "The link you have used to enter the PayPal system is invalid. Please review the link and try again."
What is the possible cause of this issue? Am I doing something wrong or is it a bug at PayPal end.
this sounds like enhanced recurring payments. Your client must verify the Paypal account using email and this should solve your problem.
AR
This is clearly an error on PayPal's side. If you click on the hosted subscription button using a browser with no PayPal cookies, you will see a screen that says "You need a PayPal account for this purchase." and then two radio buttons:
I already have a PayPal account. (and then fields for entering your Email and Password)
I need to create a PayPal account (where available).
HOWEVER, if you click on a hosted subscription button using a browser with PayPal cookies (in other words, used by someone that has a PayPal account -- not necessarily your user, but anyone that has used that browser to logon to PayPal in the past), then the screen does NOT say you need a PayPal account for this purchase, instead it says:
Check out using PayPal (followed by fields for entering your Email and Password).
And below that (and it's a little hard to see at first), it says: "No PayPal account? Pay using your credit or debit card"
If you click on that, you will get the following error:
The link you have used to enter the PayPal system is invalid. Please review the link and try again.
PayPal requires a PayPal account for subscription payments, but for reasons only PayPal knows, they have chosen to have a link on the form that suggests otherwise and only confuses poor users when they click on it (who were trying to give you money, I might add) and then vaguely they are told there was an error.
Perhaps the only current work around -- until someone brings it to PayPal's attention -- would be to warn your users on your checkout page that a PayPal account is required for subscription payments.
I used Paypal sandbox to test my code and my IPN is working.
Now, I need to go to my original Paypal account. My confusion is in sandbox, we make buyers' and sellers' accounts. And we get tit_789456613_biz#yahoo.com like seller account.
Is it needed in original account? If needed, how to make it?
If not needed, which email address should I use? Client's email or client's Paypal contact?
When you switch over from sandbox to real service you use your own real PayPal account as seller/business.
Example:
<input name="business" value="you#domain.com" type="hidden">
And you change the form action from https://www.sandbox.paypal.com/cgi-bin/webscr to https://www.paypal.com/cgi-bin/webscr
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">