Express checkout client side, execute payment

tazeg
Contributor
Contributor

A live payment has been done with express checkout api client side.

It has not been executed in the onauthorize function.

Actually I only have the paymentID.

So how can i execute it now to get the money ?

Login to Me Too
5 REPLIES 5

MTS_Andre
Moderator
Moderator

Hi, if the paymentID is like PAY-AB12CD34EF56TSTSTS you can execute those payIDs calling the REST execution method

Login to Me Too

tazeg
Contributor
Contributor

thanks, but i don't have access token nor payer id. Just the paymentID.

Login to Me Too

MTS_Andre
Moderator
Moderator

Indeed, you need the payer ID to execute it. I ran a test also executing the paymentID via the method /v1/payments/payment/{payment_id}/execute from one session where I didn't call the OnAuthorize (so I didn't execute it immediately) and I can execute it but I need to pass the payerID I am afraid,  that's a required parameter.

Login to Me Too

tazeg
Contributor
Contributor

if i have the payerID and paymentID, then how to get a token ?

Login to Me Too

MTS_Andre
Moderator
Moderator

Here the flow i nREST:

 

Make an API call: https://developer.paypal.com/docs/integration/direct/make-your-first-call/#make-an-api-call
1> get an access token: https://developer.paypal.com/docs/integration/direct/make-your-first-call/#get-an-access-token
2> create a payment with https://api.paypal.com/v1/payments/payment passing the access token
3> you get a payment_id
4> execute the payment with /v1/payments/payment/<your_payment_id>/execute

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.