This commit is contained in:
ct
2025-07-02 01:08:11 +08:00
parent 209c022f1d
commit 68a47ec916
19 changed files with 503 additions and 75 deletions

View File

@@ -2,31 +2,13 @@
namespace App\Helpers\FirstParty\Stripe;
use App\Models\User;
use Laravel\Cashier\Events\WebhookReceived;
class StripeHelper
{
public static function handleSubscriptionWebhookEvents(WebhookReceived $event)
public static function getUserByStripeID($customer_id)
{
switch ($event->payload['type']) {
case 'customer.subscription.created':
case 'customer.subscription.updated':
self::handleSubscriptionUpsert($event);
break;
case 'customer.subscription.deleted':
self::handleSubscriptionDelete($event);
break;
}
}
private static function handleSubscriptionUpsert(WebhookReceived $event)
{
///
}
private static function handleSubscriptionDelete(WebhookReceived $event)
{
///
return User::where('stripe_id', $customer_id)->first();
}
}