Update
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user