private function addTransactionReference(array &$gatewayData, $isAuthorize = false)
    {
        /** @var Payment $payment */
        $payment = $this->owner->getPayment();

        // Only apply the changes if the gateway is SagePay Server
        if ($payment->Gateway == 'SagePay_Server') {
            $type = ($isAuthorize) ? Message\AuthorizeRedirectResponse::class : Message\PurchaseRedirectResponse::class;

            /** @var PurchaseRedirectResponse $message */
            $message = $payment->getLatestMessageOfType($type);
            $gatewayData['transactionReference'] = $message->Reference;
        }
    }
private function addTransactionReference(array &$gatewayData, $isAuthorize = false)
    {
        /** @var Payment $payment */
        $payment = $this->owner->getPayment();

        // Only apply the changes if the gateway is SagePay Server
        if ($payment->Gateway == 'SagePay_Server') {
            $type = ($isAuthorize) ? Message\AuthorizeRedirectResponse::class : Message\PurchaseRedirectResponse::class;

            /** @var PurchaseRedirectResponse $message */
            $message = $payment->getLatestMessageOfType($type);
            $gatewayData['transactionReference'] = $message->Reference;
        }
    }
private function addTransactionReference ( array & $ gatewayData , $ isAuthorize = false ) { /** @var Payment $payment */ $ payment = $ this -> owner -> getPayment ( ) ; // Only apply the changes if the gateway is SagePay Server if ( $ payment -> Gateway == 'SagePay_Server' ) { $ type = ( $ isAuthorize ) ? Message \ AuthorizeRedirectResponse :: class : Message \ PurchaseRedirectResponse :: class ; /** @var PurchaseRedirectResponse $message */ $ message = $ payment -> getLatestMessageOfType ( $ type ) ; $ gatewayData [ 'transactionReference' ] = $ message -> Reference ; } }
Grabs the transactionReference from the previous received message and adds it to the
gateway data, so that it can be sent back to SagePay as clarification
@param array $gatewayData incoming gateway data
@param bool $isAuthorize whether or not we're dealing with a complete authorize request
Grabs the transactionReference from the previous received message and adds it to the gateway data so that it can be sent back to SagePay as clarification