#elianbraja

1 messages · Page 1 of 1 (latest)

near lotusBOT
granite oak
#

Hi there

#

Can you provide an example Subscription that I can look at where this occurred?

#

The ID of the Subscription specifically

proven hill
#

sub_1MlwwTEMyoEBRsWZT3AKiKhx

granite oak
#

Thanks looking

proven hill
#

thank you

#

I see that everything gets added on the upcoming invoice

#

Instead I want the customer to make the payment of the newly added items and then update the subscription

granite oak
#

Hmm not seeing the payment_behavior specified in any of those update requests

#

Sounds like you may not have saved your code or you have something cached in your backend

proven hill
#

I fixed the problem with the payment behaviour

#

I want the subscription to be on hold until the customer makes the payment of the prorated amount
how can I do that?

near lotusBOT
granite oak
#

Ah you need to pass proration_behavior as well here

#

So try proration_behavior: always_invoice

#

Since you want to actually generate an invoice here to attempt to charge

proven hill
#

ah ok, but why is it maked as paid automatically?

granite oak
#

Well it will attempt payment immediately

#

If that fails then the update won't occur

#

That is how pending_if_incomplete works

proven hill
#

It attempts from customer's default payment method?

zenith trail
#

👋 Hopping in here since bismarck has to head out soon

#

Yup, payment would be attempted with the customer's default payment method

proven hill
#

but can I change that for the subscription update?
So my flow is:

  1. Customer decides to update subscription
  2. Subscription is pending until successful payment
  3. An open invoice gets created and user can select any payment method
  4. If payment succeeds subscription gets activated
#

With these options:
payment_behavior: "pending_if_incomplete",
proration_behavior: "always_invoice"

I have no pay to specify the payment method for the charge to be applied

zenith trail
#

The only thing I can think of here is trying to use pending_if_incomplete with collection_method: send_invoice

#

But backing up for a second - do you really need a pending update? What d you want to happen if the update is never paid for?

proven hill
#

if the update is never paid the subscription should remain as it was before

#

but I also want a prorated calculation

zenith trail
#

But why do you want to allow your user to select a different payment method if they already have one that works?

proven hill
#

So you suggest to automatically collect payment from their default payment method?

#

and say that they have to change the default payment method before before updating the subscription if they want another one?

zenith trail
#

Yup

proven hill
#

but what happens if customer does not have any default payment method?

#

Where does Stripe attempt to collect payment?

zenith trail
#

If the customer doesn't have a default payment method at all then we won't attempt payment (and the update won't be applied to the subscripton)

proven hill
#

I want to add a Declined Test Card as my customer's default payment method but I cannot add it because Stripe says that is a declined card

#

how can I test?

zenith trail
#

You can use the 4000000000000341 test card if you want to test this

proven hill
#

yes, but I cannot add it to customer

#

because Stripe cannot let me add Declined Cards

zenith trail
#

How are you trying to add it to the customer? If you just add it through the dashboard it should work fine

proven hill
#

Dashboard/Payment Methods/Add

#

how am I supposed to test it?

zenith trail
#

That's a different card then the one I shared with you

#

You specifically want to use the 4000000000000341 one

#

(we have that one specifically for this use case where you want to attach a PM that will decline)

proven hill
#

ah ok

#

My last question is. If I use payment_behaviour: "error_if_incomplete" with it also keep the subscription not updated?

#

So what is the difference between "pending_if_incompleted" and "error_if_incompleted" if both of them keep the subscription not updated if payment fails?

#

apart from the fact that "error_if_incompleted" returns an error

zenith trail
#

So the difference between error_if_incomplete and pending_if_incomplete is that when payment fails with pending_if_incomplete you still have time (23 hours) to try and complete payment and have the update apply

#

If payment still isn't successful after the 23 hours then the update is expired

proven hill
#

and with error_if_incomplete the user does not have the option to retry payment?

#

isn't there an invoice created that can be retried?

zenith trail
#

That's right - with error_if_incomplete there would be no Invoice created that could be retried and you'd have to make the update call again

proven hill
#

ok I understand. Thank you