Maybe it's just late / I'm tired - but this doesn't seem to be as simple as it should be!!
I have a site in Umbraco V4 using Master templates with a "runat=server" form.
I need to be able to create the "Buy" button dynamically, or at least be able to enter the amount to be passed to PayPal.
Has anyone done something similar in V4? My needs are fairly basic - member logs in and views an invoice. The page has a PayPal button on it with the amount (and invoice number?) assigned. Member clicks button and goes to PayPal, etc.
I would also want to setup IPN to process the payment ... but one step at a time, eh ;-)
I'm not sure if this fits your needs, but here's what I did:
- Put Paypal image button on a form (a asp:ImageButton)
- Redirect to Paypal's site (and building that ugly url that holds all parameters) on image button click.
It works great for me, and might be a solution for you as well. I'm sure they're other ways to solve this... Love to hear about other's solutions.
It should be possible to use a form with hidden fields and submit using post to Paypal but I couldn't get that working, so I swithced over to creating the url which Paypal also accepts...
Be aware though. As soon as on Paypal' site, url parameters can be tampered, so you should also use IPN to verify whether users haven't been changing param values...
[quote=Dirk]It should be possible to use a form with hidden fields and submit using post to Paypal...[/quote]
The problem is that I have an ASP.Net form in the Master template which means I can't have a standard HTML form.
Actually, would it be possible to alter the "action" property of the ASP.Net form on page load? (point it at PayPal) :-k
[quote]The problem is that I have an ASP.Net form in the Master template which means I can't have a standard HTML form. [/quote]
And that is why I've been using an event handler that redirects to Paypal's site upon submit. All you need to do is build the correct url based on the relevant and various params and you're set.
[code] https://www.paypal.com/cgi-bin/webscr?cmd=xclick-subscriptions&business=BusinessName&itemname=ItemName&itemnumber=1&invoice=0008004&pagestyle=PageStyle&noshipping=1&return=Returnurl&cancelreturn=Cancelurl&nonote=1¤cycode=USD&lc=US&bn=PP-SubscriptionsBF&charset=UTF-8&a1=15.00&p1=30&t1=D&a3=5.00&p3=30&t3=D&src=1&sra=1&rm=2[/code]
Of course, not all params may be relevant to you, but you get the idea, right?
[quote=Dirk]Be aware though. As soon as on Paypal' site, url parameters can be tampered, so you should also use IPN to verify whether users haven't been changing param values...[/quote]
Does IPN apply to ALL payments made to the PayPal account, or can it be set to work for payments initiated via the web site only?
E.g. it (IPN) wouldn't make sense / work if a payment was made directly to the PayPal account as key info for the IPN function, such as invoice number, would not be known!?
Don't know, I didn't have that requirement, I was only making payments through a website.
Best place to ask is the Paypal developer forum. Just get an account and start asking questions. It's - like umbraco forum - much visited, even by Paypal professionals... I'm pretty sure you'll get an answer within a reasonable time frame.
PayPal "Website Payments Standard" - help!
Maybe it's just late / I'm tired - but this doesn't seem to be as simple as it should be!!
I have a site in Umbraco V4 using Master templates with a "runat=server" form.
I need to be able to create the "Buy" button dynamically, or at least be able to enter the amount to be passed to PayPal.
Has anyone done something similar in V4? My needs are fairly basic - member logs in and views an invoice. The page has a PayPal button on it with the amount (and invoice number?) assigned. Member clicks button and goes to PayPal, etc.
I would also want to setup IPN to process the payment ... but one step at a time, eh ;-)
Hi Gordon,
I'm not sure if this fits your needs, but here's what I did:
- Put Paypal image button on a form (a asp:ImageButton)
- Redirect to Paypal's site (and building that ugly url that holds all parameters) on image button click.
It works great for me, and might be a solution for you as well. I'm sure they're other ways to solve this... Love to hear about other's solutions.
Hope this helps.
Regards,
/Dirk
Thanks for your reply Dirk.
Did you make your own graphic, store a copy of a PayPal button locally, or point to one at PayPal (somehow?).
Can you point me in the right direction for creating the PayPal URL please?
Hi Gordon,
I've been using Paypal's image url, let me find that url again...
Here's where you'll find lots of links to docs...
https://cms.paypal.com/us/cgi-bin/?cmd=render-content&contentID=developer/howtohtmlwpstandardoverview
It should be possible to use a form with hidden fields and submit using post to Paypal but I couldn't get that working, so I swithced over to creating the url which Paypal also accepts...
Be aware though. As soon as on Paypal' site, url parameters can be tampered, so you should also use IPN to verify whether users haven't been changing param values...
Regards,
/Dirk
[quote=Dirk]It should be possible to use a form with hidden fields and submit using post to Paypal...[/quote]
The problem is that I have an ASP.Net form in the Master template which means I can't have a standard HTML form.
Actually, would it be possible to alter the "action" property of the ASP.Net form on page load? (point it at PayPal) :-k
Hi Gordon,
[quote]The problem is that I have an ASP.Net form in the Master template which means I can't have a standard HTML form. [/quote]
And that is why I've been using an event handler that redirects to Paypal's site upon submit. All you need to do is build the correct url based on the relevant and various params and you're set.
[code]
https://www.paypal.com/cgi-bin/webscr?cmd=xclick-subscriptions&business=BusinessName&itemname=ItemName&itemnumber=1&invoice=0008004&pagestyle=PageStyle&noshipping=1&return=Returnurl&cancelreturn=Cancelurl&nonote=1¤cycode=USD&lc=US&bn=PP-SubscriptionsBF&charset=UTF-8&a1=15.00&p1=30&t1=D&a3=5.00&p3=30&t3=D&src=1&sra=1&rm=2[/code]
Of course, not all params may be relevant to you, but you get the idea, right?
Regards,
/Dirk
[quote=Dirk]Be aware though. As soon as on Paypal' site, url parameters can be tampered, so you should also use IPN to verify whether users haven't been changing param values...[/quote]
Does IPN apply to ALL payments made to the PayPal account, or can it be set to work for payments initiated via the web site only?
E.g. it (IPN) wouldn't make sense / work if a payment was made directly to the PayPal account as key info for the IPN function, such as invoice number, would not be known!?
Hi Gordon,
Don't know, I didn't have that requirement, I was only making payments through a website.
Best place to ask is the Paypal developer forum. Just get an account and start asking questions. It's - like umbraco forum - much visited, even by Paypal professionals... I'm pretty sure you'll get an answer within a reasonable time frame.
Cheers,
/Dirk
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.