This commit is contained in:
ct
2025-07-03 00:48:06 +08:00
parent 0aa0d9569f
commit db892fc4f5
26 changed files with 807 additions and 59 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Helpers\FirstParty\Stripe;
use App\Models\User;
use Laravel\Cashier\Events\WebhookReceived;
class StripeHelper
{
@@ -10,4 +11,19 @@ public static function getUserByStripeID($customer_id)
{
return User::where('stripe_id', $customer_id)->first();
}
public static function getEventObject(WebhookReceived $event)
{
return $event->payload['data']['object'];
}
public static function getEventType(WebhookReceived $event)
{
return $event->payload['type'];
}
public static function setStripeApiKey()
{
\Stripe\Stripe::setApiKey(config('services.stripe.secret'));
}
}