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.
Related
I'm using PayPal Website Payments Standard built in php. Whenever the user lands on PayPal with the variables I sent, it shows a PayPal Login form and at the bottom it shows "Don't have a PayPal account? Use your credit card or bank account (where available)." I want it to default to always ask for sign up and proceed
Add variable landing_page=billing in PHP code, then the default page is pay with credit card.
<input type="hidden" name="landing_page" value="billing">
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.
I have my website and opened a paypal business account. I have setup the payment links using wishlist member and created the paypal buttons that I need to add to my website.
Now, I have the Subscribe buttons ready and they link to paypal...my problem is that I need to test it and not pay for it myself.
I DID open a sandbox paypal account too but the email and password given in paypal sanbox doesn't work on paypal and the Paypal Button code is not linking to the sandbox...it links to actual paypal.
How I'm I supposed to test these buttons if they link to paypal and not to sandbox?
How does this work? Do I need to create new buttons at Sandbox and if yes...then I'm not really testing my all ready setup right?
Can anyone clarify this?
Yes, you are correct in thinking you need to re-create these buttons under your Sandbox account in order to simulate payment without actually paying. Your Sandbox account will generate the button code with the correct sandbox links.
Moreover, when testing your Sandbox buttons, you need to use your Sandbox test account credentials to simulate the payment. Do not use actual credit card information, regardless of whether PayPal allows it or not, you're just testing.
Note: The only differences between your actual button code and Sandbox button code should only be the form action and button identifier.
Such as,
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
// versus
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
AND
<input type="hidden" name="hosted_button_id" value="FLVPFBWCKGND8"> // Actual
// versus
<input type="hidden" name="hosted_button_id" value="SNDBXGENERATD"> // Sandbox
Or, if you're not using 'hosted buttons' (the details aren't stored with PayPal):
<input type="hidden" name="business" value="your-real#email.tld"> // Actual
// versus
<input type="hidden" name="business" value="your-sandbox#email.tld"> // Sandbox
The easiest way to identify whether you're using hosted buttons or not, is to see if you've got "hosted_button_id" in your form code. If you do, you're using hosted buttons.
For a better understanding/explanation of how Sandbox is setup/integrated: Testing PayPal Website Features, or Sandbox User Guide
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">