From 607d6f179f6ed8bae149f01d11cc2cf3ad5355b8 Mon Sep 17 00:00:00 2001 From: Jesper Kold-Hansen Date: Wed, 10 Nov 2021 13:39:57 +0100 Subject: [PATCH] Switched transactionId and transactionReference since this was wrong. --- src/Models/Transaction.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Models/Transaction.php b/src/Models/Transaction.php index be7c551..47c3b4a 100644 --- a/src/Models/Transaction.php +++ b/src/Models/Transaction.php @@ -8,16 +8,16 @@ class Transaction extends Model { - const STATUS_CREATED = 0; - const STATUS_PURCHASE = 1; - const STATUS_PURCHASE_COMPLETE = 2; - const STATUS_AUTHORIZE = 3; - const STATUS_AUTHORIZE_COMPLETE = 4; - const STATUS_CAPTURE = 5; - const STATUS_REFUND_PARTIALLY = 6; - const STATUS_REFUND_FULLY = 7; - const STATUS_VOID = 8; - const STATUS_DECLINED = 9; + public const STATUS_CREATED = 0; + public const STATUS_PURCHASE = 1; + public const STATUS_PURCHASE_COMPLETE = 2; + public const STATUS_AUTHORIZE = 3; + public const STATUS_AUTHORIZE_COMPLETE = 4; + public const STATUS_CAPTURE = 5; + public const STATUS_REFUND_PARTIALLY = 6; + public const STATUS_REFUND_FULLY = 7; + public const STATUS_VOID = 8; + public const STATUS_DECLINED = 9; protected $table = 'omnipay_transactions'; @@ -138,7 +138,7 @@ public function completePurchase() Omnipay::setDefaultMerchant($this->merchant_id); $response = Omnipay::completePurchase()->send(); - $this->transaction = $response->getTransactionId(); + $this->transaction = $response->getTransactionReference(); $this->logs()->create([ 'payload' => [ @@ -208,7 +208,7 @@ public function completeAuthorize() Omnipay::setDefaultMerchant($this->merchant_id); $response = Omnipay::completeAuthorize()->send(); - $this->transaction = $response->getTransactionId(); + $this->transaction = $response->getTransactionReference(); $this->logs()->create([ 'payload' => [ @@ -406,7 +406,7 @@ public function notify() Omnipay::setDefaultMerchant($this->merchant_id); $response = Omnipay::acceptNotification()->send(); - $this->transaction = $response->getTransactionId(); + $this->transaction = $response->getTransactionReference(); $this->logs()->create([ 'payload' => [ @@ -443,8 +443,8 @@ private function getParameters($type = 'authorize') return array_merge([ 'returnUrl' => route('omnipay.complete.' . $type, [$this->id]), 'notifyUrl' => route('omnipay.notify', [$this->id]), - 'transactionReference' => $prefixedTransactionId, - 'transactionId' => $this->transaction ?? null, + 'transactionId' => $prefixedTransactionId, + 'transactionReference' => $this->transaction ?? null, 'amount' => $this->amount, ], ($this->config ?? [])); }