diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 93cc87f8cd85..1c07e5d82895 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -519,7 +519,12 @@ class StripePaymentDriver extends BaseDriver ->where('transaction_reference', $transaction['id']) ->where('company_id', $request->getCompany()->id) ->first(); - + if (empty($payment)){ + $payment = Payment::query() + ->where('transaction_reference', $transaction['payment_intent']) + ->where('company_id', $request->getCompany()->id) + ->first(); + } if ($payment) { $payment->status_id = Payment::STATUS_COMPLETED; $payment->save(); @@ -540,7 +545,12 @@ class StripePaymentDriver extends BaseDriver ->where('transaction_reference', $transaction['id']) ->where('company_id', $request->getCompany()->id) ->first(); - + if (empty($payment)){ + $payment = Payment::query() + ->where('transaction_reference', $transaction['payment_intent']) + ->where('company_id', $request->getCompany()->id) + ->first(); + } if ($payment) { $payment->status_id = Payment::STATUS_COMPLETED; $payment->save();