multiple paypal donate button - paypal

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

Related

PayPal does not return transaction information

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.

Is there a way to collect address info via Paypal donation IPNs

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.

PayPal - How do I add a passthrough HTML variable to a PayPal button?

I want to create a simple form where customers can upload a pdf and then press a pay now PayPal button. Upon opening the page (or upload), a random reference number will be assigned to the button. Once the PayPal "Pay now" button is pushed, the reference number should be passed through to me alongside the payment info such as mailing address, etc.
How do I create a customized button that takes a random number as a reference into the payment info? Thanks for any help.
The custom parameter does this with PayPal.
I.e. <input type="hidden" name="custom" value="aaaaaaaaaaa111111222222bbbbbb">.
See also this link for information on how this applies to PayPal IPN.

Confused with testing my paypal subscribe buttons

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

PayPal Subscription Button Error when selecting "Pay using your credit or debit card"

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.