Skip to content

Commit 039baf8

Browse files
committed
Handle exception when verifying Paystack transaction
1 parent d2100ae commit 039baf8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Services/PaymentHandlers/Paystack.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ public function processValueForTransaction(string $transactionReferenceIdNumber)
9393

9494
public function reQuery(Payment $existingPayment): ?ReQuery
9595
{
96-
$verificationResponse = $this->verifyPaystackTransaction($existingPayment->transaction_reference);
96+
try {
97+
$verificationResponse = $this->verifyPaystackTransaction($existingPayment->processor_transaction_reference);
98+
} catch (\Throwable $th) {
99+
return new ReQuery($existingPayment, $th->getMessage());
100+
}
97101

98102
// status should be true if there was a successful call
99103
if (!$verificationResponse->status) {

0 commit comments

Comments
 (0)