Fixes for Stripe Webhook

This commit is contained in:
Lars Kusch 2021-10-26 17:54:42 +02:00 committed by GitHub
parent 555ad1e575
commit b71c4965e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -519,7 +519,12 @@ class StripePaymentDriver extends BaseDriver
->where('transaction_reference', $transaction['id']) ->where('transaction_reference', $transaction['id'])
->where('company_id', $request->getCompany()->id) ->where('company_id', $request->getCompany()->id)
->first(); ->first();
if (empty($payment)){
$payment = Payment::query()
->where('transaction_reference', $transaction['payment_intent'])
->where('company_id', $request->getCompany()->id)
->first();
}
if ($payment) { if ($payment) {
$payment->status_id = Payment::STATUS_COMPLETED; $payment->status_id = Payment::STATUS_COMPLETED;
$payment->save(); $payment->save();
@ -540,7 +545,12 @@ class StripePaymentDriver extends BaseDriver
->where('transaction_reference', $transaction['id']) ->where('transaction_reference', $transaction['id'])
->where('company_id', $request->getCompany()->id) ->where('company_id', $request->getCompany()->id)
->first(); ->first();
if (empty($payment)){
$payment = Payment::query()
->where('transaction_reference', $transaction['payment_intent'])
->where('company_id', $request->getCompany()->id)
->first();
}
if ($payment) { if ($payment) {
$payment->status_id = Payment::STATUS_COMPLETED; $payment->status_id = Payment::STATUS_COMPLETED;
$payment->save(); $payment->save();