Check if Invoice can be refunded online programmatically
-
11-10-2020 - |
Pregunta
Is it possible to check programmatically if an given invoice can be refunded online via a payment gateway like Paypal/Braintree?
Solución
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.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange