#sadegh-akbari_code
1 messages · Page 1 of 1 (latest)
👋 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.
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
please give me more information about this !
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
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
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"],
});```
Yes that sounds good, but it still depends on if the paymentMethodId is chargable 🙂
How can you understand this?
i test it and told you my response🙏
Sorry which response? The Subscription above didn't have any payment method as far as I can see