Skip to content

Commit

Permalink
Minor fixes that allowed for better debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
addgod committed Jul 14, 2023
1 parent e26e076 commit 5108084
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Http/Controllers/OmnipayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function purchase(Transaction $transaction)

$transaction->logs()->create([
'payload' => [
'action' => 'Complete Authorization',
'action' => 'Purchase',
'message' => $response->getMessage(),
'data' => $response->getData(),
],
Expand Down Expand Up @@ -99,6 +99,9 @@ public function completePurchase(Transaction $transaction)
} elseif ($response->isCancelled()) {
$transaction->status = Transaction::STATUS_VOID;
$transaction->save();
} elseif ($response->isPending()) {
$transaction->status = Transaction::STATUS_PURCHASE;
$transaction->save();
} else {
$transaction->status = Transaction::STATUS_DECLINED;
$transaction->save();
Expand Down Expand Up @@ -151,7 +154,7 @@ public function authorize(Transaction $transaction)

$transaction->logs()->create([
'payload' => [
'action' => 'Complete Authorization',
'action' => 'Authorize',
'message' => $response->getMessage(),
'data' => $response->getData(),
],
Expand Down Expand Up @@ -200,7 +203,7 @@ public function completeAuthorize(Transaction $transaction)

$transaction->logs()->create([
'payload' => [
'action' => 'Complete Authorization',
'action' => 'Complete Authorize',
'message' => $response->getMessage(),
'data' => $response->getData(),
],
Expand All @@ -214,6 +217,9 @@ public function completeAuthorize(Transaction $transaction)
} elseif ($response->isCancelled()) {
$transaction->status = Transaction::STATUS_VOID;
$transaction->save();
} elseif ($response->isPending()) {
$transaction->status = Transaction::STATUS_AUTHORIZE;
$transaction->save();
} else {
$transaction->status = Transaction::STATUS_DECLINED;
$transaction->save();
Expand Down

0 comments on commit 5108084

Please sign in to comment.