#maverickat_best-practices

1 messages ยท Page 1 of 1 (latest)

vocal flameBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1313600929756483775

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

gilded kelpBOT
radiant pond
#

Hi there ๐Ÿ‘‹ no, I'm pretty sure the first Invoice doesn't trigger automatic retries that you can configure for your account in your Stripe dashboard:
https://dashboard.stripe.com/settings/billing/automatic

You can use our Test Clocks to confirm that though and test the full Subscription lifecycle in testmode quickly:
https://docs.stripe.com/billing/testing/test-clocks

Learn how to move Billing objects through time in test mode.

mint beacon
#

It does look like it's retrying the failed invoice (first payment on checkout) and will try to do the following invoices. The interface says under Billing method Charge default payment method

When we have a successful checkout, it will list the last 4 of the credit card used. Is there a way to see what the actually default payment method is that it is going to charge? I'm wondering if it actually has no card to retry, which would be good for this case.

radiant pond
#

Where are you setting default payment methods, on the Customer objects or on the Subscription objects?

mint beacon
#

I don't think we are explicitly setting any default payment option in our API calls

radiant pond
#

Can you share an ID of an object you're working with in your testing like the Subscription?

mint beacon
#

sub_1QS34TFTcgcvv92wXHKswgIm

#

And this is how we are setting up the subscription:

::Stripe::Subscription.update(
             subscription_schedule.subscription.id,
              # subscription starts as incomplete and only becomes active upon successful payment
              payment_behavior: 'default_incomplete',
              # Save the default payment method on the customer for future payments
              payment_settings: { save_default_payment_method: 'on_subscription' },
              metadata:,
            )
radiant pond
#

Oh, you're starting these via a Subscription Schedule, that's different. Yes I do believe retries happen then.

mint beacon
#

Is there a way to see what the default is that will be used? Just wondering if it's possible that there is no default payment method and the retries will fail?

radiant pond
#

Yes, you can retrieve the associated Customer and Subscription object to see a Payment Method is set up to be used by default, then you can retrieve the Payment Method object to get more information about it.

Yes, it's possible that a default isn't set and that retries will fail.

mint beacon
#

got it thank you very much Toby, you've been very helpful!