revert
This commit is contained in:
parent
ebe6655349
commit
38f59b9410
@ -281,25 +281,12 @@ Route::post('/payments/stripe/events', function () {
|
|||||||
break;
|
break;
|
||||||
case 'invoice.paid':
|
case 'invoice.paid':
|
||||||
$customerId = data_get($data, 'customer');
|
$customerId = data_get($data, 'customer');
|
||||||
$email = data_get($data, 'customer_email');
|
$subscription = Subscription::where('stripe_customer_id', $customerId)->firstOrFail();
|
||||||
$subscription = Subscription::where('stripe_customer_id', $customerId)->first();
|
$planId = data_get($data, 'lines.data.0.plan.id');
|
||||||
if ($subscription) {
|
$subscription->update([
|
||||||
$planId = data_get($data, 'lines.data.0.plan.id');
|
'stripe_plan_id' => $planId,
|
||||||
$subscription->update([
|
'stripe_invoice_paid' => true,
|
||||||
'stripe_plan_id' => $planId,
|
]);
|
||||||
'stripe_invoice_paid' => true,
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$team = Team::where('email', $email)->first();
|
|
||||||
if ($team) {
|
|
||||||
$subscription = data_get($team, 'subscription');
|
|
||||||
$planId = data_get($data, 'lines.data.0.plan.id');
|
|
||||||
$subscription->update([
|
|
||||||
'stripe_plan_id' => $planId,
|
|
||||||
'stripe_invoice_paid' => true,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'payment_intent.payment_failed':
|
case 'payment_intent.payment_failed':
|
||||||
$customerId = data_get($data, 'customer');
|
$customerId = data_get($data, 'customer');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user