Encoding variable amounts and seller reference data into a PayPal button URL or form

adrian1912
Contributor
Contributor

I'm totally new to PayPal as a seller. I have searched for a solution here and can't find one that's clear, relates to my situation, and works! Apologies in advance if I've missed the obvious, but maybe there are others in my position who would also benefit from an elementary explanation.

 

I'm creating a payment mechanism for an organisation that currently uses a very manual way of reconciling payments with deliverables. They get a list of payments for courses and check it against the people who turn up to them.  They're moving platforms and they want to keep the manual system but streamline it a bit. The 'items' people buy are very varied - they can pay for a whole course or individual days of it and they pay a different price as a member or non-member.  So I need to code the total cost and pass this to the payment button.

 

Now, one problem is that the new host platform disable all active content, so Javascript code won't work, only an image link or a form action. This needs to contain, either an encoding of the items purchased or our own transaction ID, and this needs to appear in the reports we can get from PayPal. I imagine this requires me to encode the arguments required by PayPal and the organisation using the REST API to insert the fields, either as arguments in the button URL, or as hidden form fields. Can this be done?  (In fact I may have to host the payment side elsewhere to allow this coding, but would still prefer to construct fields in REST than use swathes of Javascript.)

 

I've been able to use forms in the sandbox with a hosted-button-id but this presumably doesn't allow for for variable payment amounts and item details. My attempts to use hidden amount etc. fields with a sandbox form are giving various errors.

 

If you can give practical code examples I'll be happy to try them out and report back. Or if there is up-to-date _practical_ documentation, hopefully as one file, I'd be grateful to hear of it!

Login to Me Too
1 REPLY 1

adrian1912
Contributor
Contributor

Well, it looks like I must have asked the wrong question.  In the event, I've decided that I have to do this on an external server, and I seem to have found I can do what's needed with simple client-side JavaScript.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.