Skip to content
Advertisement

How to pass order ID to Paypal Button?

I create an order by my php sdk.

like this

JavaScript

and now i have this order id. but … How to pass order ID to Paypal Button? like this

JavaScript

Advertisement

Answer

Create two routes on your server, one to create an order (and return the resulting JSON), and one that takes an order id as a parameter and captures it (and returns the JSON result).

Both of these routes should return/output only JSON (no HTML or text).

Pair those two routes with this approval flow: https://developer.paypal.com/demo/checkout/#/pattern/server

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement