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