#Mathankumar-subscriptions

1 messages · Page 1 of 1 (latest)

obsidian trout
potent marten
#

i studied that, can i use "recurring": {"aggregate_usage": max}, ??

#

for my scenario!

obsidian trout
#

I feel like that might work, I'd suggest trying it out in test mode and seeing it it accomplishes what you're looking for

potent marten
#

$plan = $stripe->plans->create(
[
'nickname' => 'Test plan',
'tiers' => [
['unit_amount' => 0, 'up_to' => 10,'flat_amount' => 10000],
['unit_amount' => 1000, 'up_to' => 'inf'],
],
'recurring' => ['interval' => 'month', 'aggregate_usage' => 'max'],
'currency' => 'usd',
'interval' => 'month',
'usage_type' => 'metered',
'product' => 'prod_MCoqSXPMntgSy8',
'tiers_mode' => 'graduated',
'billing_scheme' => 'tiered',
'expand' => ['tiers'],
]
); is right?

obsidian trout
#

I think that's correct yep, you can try it in test mode.

potent marten
#

it showing error like Stripe\Exception\InvalidRequestException: Received unknown parameter: recurring in file /home/mathank/Documents/projects/success-api/vendor/stripe/stripe-php/lib/Exception/ApiErrorException.php on line 38

obsidian trout
#

ah right because you're using stripe->plans instead of Prices for some reason

hybrid flicker
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

potent marten
#

Okay