#miloskec-subscription-promo-code

1 messages · Page 1 of 1 (latest)

verbal star
clear lodge
#

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?

verbal star
#

thank you @clear lodge ! - will catch up here shortly

clear lodge
#

thanks @verbal star

clear lodge
#

@verbal star if you need more info please let me know

verbal star
#

Can you share how you including that coupon for the new subscription case?

clear lodge
#

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
]);

verbal star
#

Your screenshot is showing the upcoming invoice, what was the initial invoice? i'd expect that one to have been discounted.

clear lodge
#

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

verbal star
#

the second screenshot was the "new" subscription right?

clear lodge
#

yup

verbal star
#

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

clear lodge
#

no no... coupon is generated every time when customer make subscription

verbal star
#

can you share that subscription id? one of the new ones?

clear lodge
#

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

verbal star
#

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?

clear lodge
#

I am confused now...

#

every time when I created subscription with coupon I have invoice without coupon and without discount

verbal star
#

thats the "upcoming" invoice, the next one

clear lodge
#

as I show you in screenshot

verbal star
#

not the one you already finished paying when you created the subscription

clear lodge
#

ohhhh

verbal star
#

when you run the subscription.create command, look at the latest_invoice id

clear lodge
#

so sorry @verbal star

verbal star
#

or expand it with 'expand' =>['latest_invoice']

#

np!

#

does it make sense now?

clear lodge
#

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

verbal star
#

glad it seems to be working for you 🙂