#dineshkumar_docs

1 messages ¡ Page 1 of 1 (latest)

median spruceBOT
#

👋 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/1361718726478794922

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

dull hamlet
#

subscription id is - sub_1REAwcBUmBAZBIgtE8wZ3X5i

brazen relic
#

I don't understand the question

dull hamlet
#

this subscription is active sub_1REAwcBUmBAZBIgtE8wZ3X5i
when i try to test decline test card 4000000000000002 , why?

#

subscription subscription should failed right?

brazen relic
#

There's no payment due until May 1 because you passed:

    day_of_month: "1",
  },```
#

So the invoice the subscription was paid with was $0

#

Which would not fail

dull hamlet
#

but the card is invalid right?

#

card 4000000000000002

brazen relic
#

Yes

#

There was no payment due though

#

So no card was processed

dull hamlet
#

next montlhy cycle billing will failed right? for invalid card

brazen relic
#

Not right now no

#

You don't have a default payment method set on the subscription or customer

#

Actually it will fail

#

Because there's no card saved to charge

#

But I don't see 4000000000000002 saved anywhere

dull hamlet
#

i was set PaymentSettings for save default payment method,
PaymentSettings = customer.InvoiceSettings.DefaultPaymentMethodId == null ? new SubscriptionPaymentSettingsOptions { SaveDefaultPaymentMethod = "on_subscription" } : null,

brazen relic
#

Yes but I don't see any request where you collected that payment method

dull hamlet
#

wait i will create again subscription..

#

yes, i can see error on payment element "Your card was declined."

#

but subsription was active why?

#

sub_1REBI5BUmBAZBIgtt9Zsc4D2

brazen relic
#

This is the exact same scenario as before

#

First invoice isn't until May 1

#

No payment is due rn, so it starts as active with a $0 invoice

#

You see the error "Your card was declined." because it's a decline test card and isn't saved to the customer since it's failing

#

But subscription doesn't require payment

dull hamlet
#

before 3 days we sent to customer, "your subscription will renew soon" this is correct? because the not save payment method..

#

on april 28th, we sent "your subscription will renew soon"

#

we seeting up the customer emails on stripe dashboard renewal email should send before 3 days..

brazen relic
#

I don't understand the question. You're saying the email was sent?

dull hamlet
#

if No payment is due rn, so it starts as active with a $0 invoice,
in this secanrio send emails to customer "your subscription will renew soon" this is correct?

#

before 3 days, on april 28th, subscriprion will renew May 1

brazen relic
#

Hm not sure. Are you seeing the email being sent? I'm not sure whether or not it fires for the first non-zero Invoice

dull hamlet
#

you can see here

brazen relic
#

Ah ok so I guess it does

dull hamlet
#

this mail send to customer , even the paymethod not saved for $0 payment subscription

#

why? we can't stop? above email

#

we can't stop the subscription has Active, if card failed if $0 payment

brazen relic
#

Correct. That's just how Subscriptions work

#

If Subscription is created and first invoice is $0 it will start as active

#

Because no payment is due

dull hamlet
#

if card failed, what happen if invoice is $0

dull hamlet
brazen relic
#

There was no payment due

#

So the $0 invoice succeeded

brazen relic
dull hamlet
#

understood!

brazen relic
#

So that you don't create the subscription unless payment method is collected successfully

dull hamlet
brazen relic
#

I just did...

dull hamlet
#

i tried this

#

if $0 invoice and invalid card "Your card was declined."

#

subscription was active, if $0 invoice and invalid card

brazen relic
#

Oh sorry I think I linked the wrong doc

dull hamlet
brazen relic
#

Ah right sorry

#

Are your subscriptions always going to start with a $0 Invoice?

dull hamlet
#

yes

brazen relic
#

Ok cool

#

So I recommend using a SetupIntent to collect payment method details. That way you can wait to create the Subscription ONLY IF the SetupIntent succeeded

dull hamlet
#

some customers $0 some customer $12

brazen relic
dull hamlet
#

if applied Promocode invoive is $0

brazen relic
#

That's really the only way to achieve this without creating the subscription as active

#

To collect payment method via setupintent and then only create subscription if setupintent succeeded

median spruceBOT
dull hamlet
#

if applied proration invoive is $0

#

no i need collect paymethod on purchase/on create subscription

dull hamlet
brazen relic
#

I'm sorry but there's not a way to do that as I said before

#

If you need to do it on subscription create, then Subscriptions with $0 invoices will always start as active

#

That's just how Subscriptions work

dull hamlet
#

understood!