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!
2
Answers
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.
You can’t using V2 but V1 API is still available so you can use that API.
Python 3.x sample: