Closed obrunsmann closed 3 months ago
There is a new feature called "Meters" which seems to be the new way to report usage to stripe:
https://docs.stripe.com/api/billing/meter-event
This is some sample implementation which I now use.
<?php $payload = [ 'event_name' => 'meter_name', 'payload' => [ 'value' => $event->count, 'stripe_customer_id' => $event->user->stripe_id, ], ]; $stripe = Cashier::stripe(); $stripe->billing->meterEvents->create($payload);
Usage records seems to get deprecated. For now we could implement a method like
public function createMeterEvent( string $eventName, int $value = 1, string $eventPayloadKey = 'value', string $identifier = null, \DateTimeInterface|int|null $timestamp = null, ) : \Stripe\UsageRecord {}
Yeah I'd love to see support for this in Cashier. Welcoming PR's!
Is this deployed in new version of cashier?
No, we haven't gotten a PR yet
There is a new feature called "Meters" which seems to be the new way to report usage to stripe:
https://docs.stripe.com/api/billing/meter-event
This is some sample implementation which I now use.
Usage records seems to get deprecated. For now we could implement a method like