Question

Is it possible to check programmatically if an given invoice can be refunded online via a payment gateway like Paypal/Braintree?

Was it helpful?

Solution

For anyone having a similar requirment my solution was to check the following:

  • Can the invoice be refunded ($invoice->canRefund())
  • Does the invoice have an transaction id ($invoice->getTransactionId())

Please note, that this doesn't verify if the gateway does support online refunds (e.g. Paypal/Braintree supports it)

I didn't find any other solution and I'm still open for alternatives.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top