curl - how to submit to paypal javascript sdk

Viewed 130

how to submit to paypal javascript sdk using curl

<script src="https://www.paypal.com/sdk/js?client-id=1234" data-client-token="4321">

client-id is query parameter but how about data-client-token? it is not query and post not support

below did not work

#curl https://www.paypal.com/sdk/js?client-id=1234
#curl -d "data-client-token=4321" https://www.paypal.com/sdk/js?client-id=1234
#curl -H "data-client-token=4321" https://www.paypal.com/sdk/js?client-id=1234
1 Answers

how to submit to paypal javascript sdk using curl

You don't, not ever. The JavaScript SDK should always be loaded directly by a web browser at runtime. See here for a basic demo.


If you want to use curl or another backend/server-side tool, instead use the v2/checkout/orders API, documented here.

The best front-end approval flow to pair with the above server-side routes ('Create an Order' and 'Capture Order') will still make use of the JavaScript SDK from a browser: https://developer.paypal.com/demo/checkout/#/pattern/server

Related