Closed Semvrij closed 1 year ago
Hi @Semvrij,
Thank you for your suggestions!
We have implemented the canBeCanceled()
method in the Refund
class as you suggested in #683.
However, we have decided not to implement the change for the cancel()
method. The primary reason behind this decision is that we want to maintain consistency with other cancel()
calls in our package. Implementing a change to the cancel()
method specifically for the Refund
class would introduce an inconsistency within our package, which could potentially confuse users.
You can still implement the refund status change in your code by wrapping the $refund->cancel()
method inside a try/catch statement and set the status to RefundStatus::STATUS_CANCELED
if the call succeeds.
Refund
classcanBeCanceled()
methodA getter for the
Refund
class, to know if a refund can be canceled. Something like thecanBeRefunded()
method on thePayment
class.Change the
RefundStatus
after using thecancel()
methodAfter using
$refund->cancel()
change theRefundStatus
toSTATUS_CANCELED
or not if failed. It feels unnecessary to do another request right after.