Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
400 views
in Technique[技术] by (71.8m points)

How do I cancel/void an order using Paypal API V2?

What is the equivalent to https://developer.paypal.com/docs/api/orders/v1/#orders_cancel in the V2 of Paypal API?

After an order has been Authorised (using API v2 authorize request with 'CREATED' response), I want the user to be able to cancel it after the click of a button. That button runs a cancel() method.

So my question is, what request should I put in the cancel method to cancel/void the existing order using the orderID? I know I could just leave the order be in V2, but I specifically want to void/cancel it. (Also, I can only use post, put and patch requests with the implementation I've been given)

Would really appreciate it if you could provide the curl command or nodeJS fetch implementation for it.

Thank you in advance!

question from:https://stackoverflow.com/questions/66054105/how-do-i-cancel-void-an-order-using-paypal-api-v2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If the v2 order was intent:'authorize' and you 'COMPLETED' it to get back an authorization object, you can void the authorization using the v2/payments API.

If, however, the order was merely 'CREATED' or 'APPROVED', there is no way to cancel or void it. Simply have your system forget about it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...