Skip to content

Commit

Permalink
Switched transactionId and transactionReference since this was wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
addgod committed Nov 10, 2021
1 parent 6780383 commit 607d6f1
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/Models/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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' => [
Expand Down Expand Up @@ -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' => [
Expand Down Expand Up @@ -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' => [
Expand Down Expand Up @@ -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 ?? []));
}
Expand Down

0 comments on commit 607d6f1

Please sign in to comment.