sm321
sm321

Reputation: 3

PayPal Button Custom Price

I'm very soon looking to make a website with PayPal integration to handle payments. What I'm planning on doing is have two options; Option A which will cost $1 per "1" quantity and Option B which will cost $5 per "1" quantity.

So if a user picks Option B and a quantity of 20 the total cost will be $100.

How can I have a "Buy Now" button where the price "request" is whatever the total cost is (so in this case the price request will be $100).

Thank you.

Upvotes: 0

Views: 301

Answers (1)

Drew Angell
Drew Angell

Reputation: 26056

That's a pretty wide open question, so this will probably be a pretty wide open answer.

You've got lots of options. Will you be working with PHP? do you JavaScript well? Both? You could build a form one page that POSTs to another page, and then dynamically output the PayPal checkout button with that form data.

If you wanna get more slick than that you could use some jQuery or any basic JavaScript to automatically update the values on the form so it doesn't have to reload any new page.

The thing is, in order to get that sort of thinking working with Payments Standard you have to build the forms with all the fields on the page, which people can then see if they view source, and you could be susceptible to people hacking your stuff to try and submit orders at cheaper prices. There are ways to resolve this within an IPN solution, but if you're familiar with PHP or some other language, and you'll be using it anyway, then I would really recommend moving to the Express Checkout API's.

Express Checkout gives you a lot more freedom and flexibility to build your applications however you need without worrying about prying eyes. There are other advantages, too, like users will always end up on your site as opposed to Payments Standard. Even with Auto-Return enabled, users might not make it back to your thank you page when using Standard, so that may or may not be a big deal for you (although, it generally becomes an issue at some point as your website grows.)

Sorry for the long answer, but hopefully that helps.

Upvotes: 1

Related Questions