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
Related
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 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'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
I am building a web site for an organisation. The organisation can create as many programs as they want.
Each program should have a paypal donate button. when creating a program, a paypal donate button can be inserted automatically (something like {donate_button: label } ).
i want to keep track of each program donation fees.
So i need somehow to know what program a donor donate to so then i can make a report about fee for each program.
Am not so sure how to get this done properly. is it possible to add some parameters in the donate paypal button dynamically ? if posible , is there any problem regarding to security ?
Can paypal donate button be created dynamically ?
I am very appreciated for all of you .
Thanks
Am sorry for my bad English.
I'd suggest looking at Instant Payment Notification (IPN) and 'custom' to pass the name of the organisation on to PayPal.
Simply include the following in your existing button code
<input type="hidden" name="notify_url" value="link to IPN script">
<input type="hidden" name="custom" value="name of organisation / other unique identifier">
and read the IPN POST for the 'custom' parameter when it comes through.
There's additional documentation and some sample code at https://www.paypal.com/ipn
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">