src/Client.php
public function cancelPayment($paymentToken, $reason = null)
    {
        if (!$paymentToken instanceof CancelPaymentRequest) {
            $paymentToken = new CancelPaymentRequest($paymentToken);
        }

        if ($reason !== null) {
            $paymentToken->setReason($reason);
        }

        ObjectRecursiveValidator::validate($paymentToken);
        $paymentSerializer = new CancelPaymentSerializer($paymentToken);
        $paymentTransport = new CancelPaymentTransport($paymentSerializer);

        return $this->execute($paymentTransport, CancelPaymentResponse::class);
    }
public function cancelPayment($paymentToken, $reason = null)
    {
        if (!$paymentToken instanceof CancelPaymentRequest) {
            $paymentToken = new CancelPaymentRequest($paymentToken);
        }

        if ($reason !== null) {
            $paymentToken->setReason($reason);
        }

        ObjectRecursiveValidator::validate($paymentToken);
        $paymentSerializer = new CancelPaymentSerializer($paymentToken);
        $paymentTransport = new CancelPaymentTransport($paymentSerializer);

        return $this->execute($paymentTransport, CancelPaymentResponse::class);
    }
public function cancelPayment ( $ paymentToken , $ reason = null ) { if ( ! $ paymentToken instanceof CancelPaymentRequest ) { $ paymentToken = new CancelPaymentRequest ( $ paymentToken ) ; } if ( $ reason !== null ) { $ paymentToken -> setReason ( $ reason ) ; } ObjectRecursiveValidator :: validate ( $ paymentToken ) ; $ paymentSerializer = new CancelPaymentSerializer ( $ paymentToken ) ; $ paymentTransport = new CancelPaymentTransport ( $ paymentSerializer ) ; return $ this -> execute ( $ paymentTransport , CancelPaymentResponse :: class ) ; }
@param string|CancelPaymentRequest $paymentToken
@param string|null                 $reason

@return CancelPaymentResponse|AbstractResponse

@throws ResponseException
@throws TransportException
@throws ResponseParseException
@throws JsonParseException
@param string|CancelPaymentRequest $paymentToken @param string|null $reason