I've got a scenario where I need to collect address details from Paypal when a user donates to a site. From what I can tell in the Paypal Sandbox those details aren't returned via IPN or PDT when the transaction is related to a donation.
Is there something I'm missing like an account setting or paypal variable that can make this possible?
At the moment I'm using a Buy Now option as below which does return address details:
input type="hidden" name="cmd" value="_xclick"
Simply changing the cmd to donation and the address info stops coming in via IPN:
input type="hidden" name="cmd" value="_donations"
I don't believe the address is given on donations. Your best bet is to call it a donation in the title & then send it still as an xclick. Change the displayed button image to a donation button, but use an xclick instead of _donation. I believe that's the only possible way.
Related
I'm trying to integrate PayPal on my site and I have problems with receiving information from PayPal about transaction.
I'm using sandbox environment for tests.
I generated the form and placed return url into there:
<input type='hidden' name='return' value='my-local-site/success.php'>
After all payments are done (and they are done correct - I'm getting money to my account) I'm returned to my-local-site/success.php without any parameters about this transaction.
I tried to make it like here - http://www.dollarfry.com/paypal-integration-guide-php/ but it does not work for me.
My question is why I don't receive any information about transaction from PayPal as payments were done correctly via sandbox (money were sent from one account to another correctly).
I want to get some info like
http://my.local.site/success.php?tx=6BC88318RN685282M&st=Completed&amt=20.00&cc=USD&cm=&item_number=BEAR05
What should I do to get that info? Is something wrong I do, or with my account?
Thank you!
Try adding an extra parameter.
<input type="hidden" name="rm" value="0" />
Check PayPal's HTML variables documentation for more details. Search for "return method" on that page and you should find it easily.
I have a hosted PayPal form setup for a Subscribe button.
I send the return URL like so:
<input type="hidden" name="return" value="http://myurl.com/returnurl" />
This works fine, upon payment the user gets redirected to this URL.
I also send the item_number parameter like so
<input type="hidden" name="item_number" value="{{uid}}" />
{{uid}} is a template tag and I have verified when viewing the source code it is being filled correctly. For testing I was using uid 15.
When the user clicks the PayPal Subscribe button it takes them to the PayPal gateway. I have verified by using Developer Tools in Chrome that the correct uid (15 in this case) is being sent in the HTTP headers.
The problem is that all IPN notifications have the item_number 1 (I'm checking in the IPN history of the PayPal website, where it lists the parameters sent for each message.)
Can anyone think of why item_number is being sent as 1, and not the correct value?
Thanks
It appears item_number isn't always a variable you can set. When setting up a product to sell in the PayPal control panel you specify and item description and an item number. I'd setup the item_number of 1 and so even though I was setting it in my HTML <form> it was being overwritten by the item number I'd already setup.
The solution was to use a different custom field.
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
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">