#miloskec-subscription-promo-code
1 messages · Page 1 of 1 (latest)
I will update comments - so everything will be here.
This is working well - when updating subscription
But, when I try to apply coupon on the new subscription , stripe is ignoring that coupon and user is charged for the full amount.
Can someone please let me know what is going on? I have used example from the documentation and it works well only for update
How should I overcome this?
thank you @clear lodge ! - will catch up here shortly
thanks @verbal star
@verbal star if you need more info please let me know
Can you share how you including that coupon for the new subscription case?
I have tried different ways (even not documented or combination with checkout ) but what I am using is this
$subscription = $stripe->subscriptions->create([
'customer' => $user->stripe_id,
'items' => [
['price' => $request->plan]
],
'proration_behavior' => 'none',
'coupon' => $creditsPayId
]);
Your screenshot is showing the upcoming invoice, what was the initial invoice? i'd expect that one to have been discounted.
first screenshot is showing updated! subscription for the different user
and that works well
but other is showing normal..without coupon and without discount - when I try to create new subscription
the second screenshot was the "new" subscription right?
yup
but you arent showing the first invoice, the one that would have been discounted
the second (upcoming) invoice i would not expect to be discounted, because your coupon is valid "once" -- that "once" is on the first/initial invoice
look at the other paid invoice on that subscription
no no... coupon is generated every time when customer make subscription
can you share that subscription id? one of the new ones?
its complete different and independent.. I just attached first screenshot so you could see that subscription update with coupon works
the new one: sub_KE2mzIshsyXDq2 without discount but should have discount
I have also deleted few subscriptions because I didnt got discount
with that same user
so you can check all
in_1JZah4KIAGB2EePlMkwnzeeG
Thats the first invoice for the subscription you created, it is discounted
This looks expected
Do you expect a discount on the second invoice too, at renewal time?
I am confused now...
every time when I created subscription with coupon I have invoice without coupon and without discount
thats the "upcoming" invoice, the next one
as I show you in screenshot
not the one you already finished paying when you created the subscription
ohhhh
when you run the subscription.create command, look at the latest_invoice id
so sorry @verbal star
My fault. I was testing first with update and as expected I checked coupon code on the next invoice... and now instead to check the invoice I have checked next invoice
yes... everything make sense
thank you again
glad it seems to be working for you 🙂