src/BackendService.php
public function process(Transaction $transaction, $operation)
    {
        $response = parent::process($transaction, $operation);

        if ($response instanceof FailureResponse && $operation == Operation::CANCEL
            && $transaction->getBackendOperationForRefund()) {
            return parent::process($transaction, Operation::REFUND);
        } else {
            return $response;
        }
    }
public function process(Transaction $transaction, $operation)
    {
        $response = parent::process($transaction, $operation);

        if ($response instanceof FailureResponse && $operation == Operation::CANCEL
            && $transaction->getBackendOperationForRefund()) {
            return parent::process($transaction, Operation::REFUND);
        } else {
            return $response;
        }
    }
public function process ( Transaction $ transaction , $ operation ) { $ response = parent :: process ( $ transaction , $ operation ) ; if ( $ response instanceof FailureResponse && $ operation == Operation :: CANCEL && $ transaction -> getBackendOperationForRefund ( ) ) { return parent :: process ( $ transaction , Operation :: REFUND ) ; } else { return $ response ; } }
Build in fallback for refund

@param Transaction $transaction
@param string $operation
@return FailureResponse|Response\InteractionResponse|Response\Response|Response\SuccessResponse
Build in fallback for refund