I've integrated Paypal's Classic API with a website that is currently happily working in production. I create a "billing agreement" for customers and then use that billing agreement to perform a DoReferenceTransaction API Operation with PAYMENTACTION=Sale
and this collects money from my customers.
I'd like to provide functionality for admins to cancel or void a sale transaction if possible, but the Paypal DoVoid operation appears to be limited to authorizations and orders but not actual sales. I do see that Paypal offers the RefundTransaction API operation and I expect to implement this, but I was hoping to perhaps Void or Cancel a sale that had not been collected yet. It's been my experience with other payment gateways that cancelling a sale before the money is actually collected (typically at close of business on weekdays) is cleaner and less likely to incur the wrath of your merchant bank's escrow specialists.
Is it possible to Void a transaction with PAYMENTACTION=Sale
performed via the DoReferenceTransaction
API operation? Or must you use the RefundTransaction
API operation?
No it is not possible to void a sale transaction. If you can't change paymentaction from sale to auth/order then the only option you have is to use RefundTransaction API (PayPal has NVP as well as rest end point for refund API)