I would like to have a simple form with two textfields and a button:
- product id
- amount
- Checkout
When clicking on a button the default PayPal checkout appears with product id and an amount pre-populated. How do I achieve that with Javascript?
update
I would like to achieve this strictly using Javascript, no server side code such as PHP. It would work more like a generic PayPal button with two more textfields carrying product ID and amount.
update 2
Instead of searching for PayPal Javascript API, I should've searched for PayPal button custom amount. Looks like this will solve my question.
Passing price variable to PayPal with custom button
https://www.paypal.com/us/cgi-bin/webscr?cmd=_pdn_xclick_techview_outside