@crypt.001111101 I am not farming post. I am trying to let you know there are multiple ways to find out what the payload stripe sends you is, including just setting up the event listener and logging the data, such as:
class StripeEventListener
{
public function handle(WebhookReceived $event)
{
dump($event->payload);
info($event->payload);
}
}
I find it rather nice to go into my stripe dashboard under webhooks and see the data in their event explorer that were sent.
What you are asking for is part of the payload...the customer which is the ID cashier stores on your users table for stripe_id. example payload:
{
"id": "evt_id",
"object": "event",
"api_version": "2020-08-27",
"created": 1639892129,
"data": {
...
"customer": "cus_Ab1Cd2E4hY", // You want this
...
},
"livemode": false,
"type": "customer.subscription.updated"
}
You can take that customer and use cashier to find via Billable
use Laravel\Cashier\Cashier;
$user = Cashier::findBillable($stripeId); //cus_Ab1Cd2E4hY
Also I find it helpful to check out the cashier controller for how they handle the included events:
https://github.com/laravel/cashier-stripe/blob/13.x/src/Http/Controllers/WebhookController.php#L68