#sadegh-akbari_code

1 messages · Page 1 of 1 (latest)

sly krakenBOT
#

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

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

glass crystal
#

It means the PaymentMethod to be used for the Subscription cannot be charged

#

The bank may declined it

#

If you can provide the Subscription Id, would be happy to take a look

mellow pecan
mellow pecan
#

I had another question
When I create a schedule I don't give it any card information and only give it the customerId
How does stripe know which user the card information belongs to
I need help with this

glass crystal
#

Well you need to collect the card, somehow

#

You will to collect it and set to the Subscription's payment_method

#

The Subscription Schedule may try to use a default card previously set on the Customer and failed... Don't know unless you could provide a Subscription Id to look at

mellow pecan
glass crystal
#

Yes, can you provide the Subscription Id? sub_xxx

#

Or Invoice Id in_xxx

mellow pecan
#

sub_1Qw0OmDaFEL86M0VtI0wQiq5

#

i changed my code and pass paymentMethod in schedule
this is correct ?

      customer: customerId,
      type: "card",
    });
    
    const paymentMethodId = paymentMethods.data[0]?.id;

    const schedule = await stripe.subscriptionSchedules.create({
      customer: customerId,
      start_date: startDateUnix2,
      
      phases: [
        {
          items: [{ price: priceId, quantity: 1 }],
          default_payment_method: paymentMethodId,
        },
      ],
      expand: ["subscription.latest_invoice.payment_intent"],
    });```
glass crystal
#

Yes that sounds good, but it still depends on if the paymentMethodId is chargable 🙂

mellow pecan
#

How can you understand this?

glass crystal
#

Um what do you mean?

#

We won't know until it's attempted

mellow pecan
#

i test it and told you my response🙏

glass crystal
#

Sorry which response? The Subscription above didn't have any payment method as far as I can see