#default_user_Bq67qllUp5l4mHuk0ao
1 messages · Page 1 of 1 (latest)
Hi
if valide=true, the coupon can be applied otherwise no.
iof the coupon is no longer active
what will be the value valid?
my flow of coupon is so :
- user type promo code
- backend checks if code exist using stripe.promotionCodes.list({ code });
- if copun exist - it gets added to customer and gets redeemed
- the retrned object from customer.update containes the copun
- sending this object back to user where they can see copun name
the problem with the flow:
if the copun is at max redeemed - even though its still added to customer
the returned object is valid = false
and we do not return it to customer
step number 5 is skipped
even though the customer has coupon
now, either we can ignore the value of valid
or change the flow
what do you suggest is the better flow?
valid is boolean, so the value will be false
i understnad - but in what case ?
if the copun is at max redeemed - even though its still added to customer
That means the coupon can no longer be used for another customer.
I'm not sure I understand the issue here, do you have a coupon example ?
yes
check req_c9GxrxXm51TJu2
the coupon there is on time use,
we added it to customer
the returned answer is the coupon is not valid -- even though for this customer it is beecause its already assigned
so for me its hard to know when its not valid because its actually not active or becasue in the future it will not be active
the returned answer is the coupon is not valid -- even though for this customer it is beecause its already assigned
yes because it was already used.
that coupon isn't active simply and will not be applied.
so in the flow above - i can ignore the valid value given the whole flow workeD?
You can ignore it yes, but the coupon isn't valid and won't be applied at the end
That coupon was used before or this is the first time you assigned to that customer ?
so it will be applied for that customer once.
If you want, what you can do is to check valid status before attaching the coupon to the customer, if valid attach it otherwise use another coupon. Then ignore the valid status in the response.
ok thanks
but nothing will happen between checkong the field to the assignment?
Nope, I invite you to can continue your testing scenario.