#mamidd

1 messages · Page 1 of 1 (latest)

scenic tigerBOT
wispy charm
#

Hi! Let me help you with this.

torn stone
#

i wouldnt expect this behaviour because the item with month interval has quantity 0

wispy charm
#

Are you following a particular guide from Stripe docs?

torn stone
#

the little guide about pending update process, let me find it

wispy charm
#

The new Subscription Item should have the same item ID, but with different price. Then you will not get the error.

#

OLD_SUBSCRIPTION
item with month interval with quantity 1

NEW_SUBSCRIPTION
item (with the same id value) with year interval with quantity 1

torn stone
#

the id you are mentioning which id is?

#

you mean this?

wispy charm
#

Yes

torn stone
#

ok and how can you manage this scenario:

#

OLD_SUBSCRIPTION

  • item1 with month interval with quantity 1
  • item2 with month interval with quantity 1

NEW_SUBSCRIPTION

  • item1 (with the same id value) with year interval with quantity 1
scenic tigerBOT
torn stone
#

in this scenario the customer has a subscription with two items monthly and want change his subscription to only 1 item yearly

unreal palm
#

you also need to pass an item with deleted:true to remove the other item if that's the goal

torn stone
#

all this is compatible with pending_if_incomplete? because for my ecommerce logics i need the pending_if_incomplete method

unreal palm
#

not sure if it's compatible, you'd have to test it

torn stone
#

my thread starter from this point. why stripe give me a mismatch interval in a subscription if i have an item with quantity 0 monthly and an item with quantity 1 yearly?

#

it's not the expected behaviour

unreal palm
#

you can't have a subscription that is subscribed to both a monthly and a yearly plan at the same time

#

if you were trying to change from a monthly to a yearly a plan, then you made the API call incorrectly. Often people forget to pass the id of the item, so you're actually adding a new item. I'd need to see you exact code and request IDs req_xxx to say more.

torn stone
#

where can i get the req_xxx?

#

ok found, i reproduce the error and i give you the req_id

#

req_rU6Sf4vKvrNDbJ

unreal palm
#

in that request you are adding a new Price price_1NAZg8F83rF8iubkeud5BUKT, and you are changing the quantity of an existing item to 0.

#

is that what you wanted to do?

torn stone
#

and this is the other use case: req_uCJdNqAQanrWwc

torn stone
unreal palm
torn stone
#

how can i manage this scenario with this payment_behavior?

unreal palm
#

the subscription currently exists as

  • item si_NzOsGIYRTmMqWo — monthly plan 15/month
    -item si_NzOi8WsUrCm0Vd - monthly plan 29/month
torn stone
#

yes

unreal palm
#

your update call is trying to change it to

  • item si_NzOsGIYRTmMqWo — monthly plan 15/month
  • delete item si_NzOi8WsUrCm0Vd
  • add new item yearly plan
torn stone
#

i would substitute all items with an item with price price_1NAZg8F83rF8iubkeud5BUKT

unreal palm
#

and you can't do that since you are adding a yearly plan when it already has a monthly plan.

torn stone
#

ok try to see this request instead: req_uCJdNqAQanrWwc

#

in this request i managed both items to quantity zero

#

adding the new price yearly

unreal palm
#

well try deleting them properly

#

i.e. do {id:"si_xxx", deleted:true}

#

instead of the weird setting quantity to 0

torn stone
#

i cant use the deleted:true in prending_if_incomplete

#

the API says me that is unsupported

unreal palm
#

then like I said, Unfortunately the pending update feature doesn't support everything so in many cases it's not an option to use

torn stone
#

i need to use pending_if_incomplete because for my ecommerce logic

#

i need to "try" the update of a subscription waiting for customer payment

#

if payment suceed so my ecommerce should apply the new features

#

if payment fails i need to cancel the update

#

one of the scenario is if user use 3DS required cards

#

all others payment_behavior didnt manage properly async payments like 3DS

unreal palm
#

like I said the pending updates feature doesn't work for every use case, I'm sorry, I wish it did

#

so you have to handle this in different ways like manually rolling the subscription back to its previous state if the payment attempt fails, or doing a separate payment instead and doing the update to the subscription only if that succeeds

torn stone
#

how can i do a separate payment and after manager the subscription update? what apis should i use?

#

i could follow this solution but i need that the update of subscription won't charge again the customer. is it possible?

unreal palm
torn stone
#

uhm ok

#

but sorry, with proration_behavior:none strippe will charge with the full price the customer

#

it doesnt' avoid charging the user

unreal palm
#

did you test that and see it be the case?

scenic tigerBOT
torn stone
#

yes i tested an update of subscription with proration_behavior:none and it charged the customer

low relic
#

Can you share the requestId of the update request ?

torn stone
#

req_uCJdNqAQanrWwc

low relic
#

This is a failed request, and you passed proration_behavior:always_invoice and not none

torn stone
#

ah you mean the req_id with proration_behavior:none?

#

i understood the request that generate my initial issue