Skip to content Skip to sidebar Skip to footer

How Do I Extract Orderid From This Object/response & Pass It To Another Function Onapproval? (paypal Api)

Please see this example -> https://developer.paypal.com/demo/checkout/#/pattern/client The createOrder func there returns this -> {'id':'8GS56714S6789541X','intent':'CAPTURE'

Solution 1:

Please see this example -> https://developer.paypal.com/demo/checkout/#/pattern/client

As you're using node.js and typescript, shouldn't you be using the server API samples at: https://developer.paypal.com/docs/business/checkout/server-side-api-calls/#server-side-api-calls

(make one server route for 'Create Order', and one for 'Capture Order', both of which should return JSON)

Paired with the approval flow example at, rather: https://developer.paypal.com/demo/checkout/#/pattern/server


Anyway, to really answer your question, onApprove should be:

onApprove: function(data, actions) {

It will be called with the orderID in data.

Post a Comment for "How Do I Extract Orderid From This Object/response & Pass It To Another Function Onapproval? (paypal Api)"