#gopi_67606
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- gopi_67606, 6 days ago, 20 messages
Hi, how can I help?
I am unable to create the subscription using live card details but I am able to create a subscription with test cards any difference?
Do you see any errors? Could you please share the Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
cus_Oy7f4134RRYmMg
Do you see any errors?
No errors
I don't understand. What does this mean? "I am unable to create the subscription"
Why do you think you unable to do so?
The default payment method is not created
Subscription is not yet created
const customer = await stripe.customers.create({
email: email,
name: name,
})
stripe.customers.createSource(
customer.id,
{
source: "tok_visa",
},
async function (err, card) {
if (err) {
} else {
customer.default_payment_method = paymentMethodId
const subscription = await stripe.subscriptions.create({
customer: customer.id,
items: [{
price: planId == 3 ? environment.priceId : environment.pId, // Replace with your product's price ID
},],
});
res.json({ success: true, subscription, customer, planId });
}
}
);
First I am creating the customer & after that I am linking that customer to the default payment method after that I am creating the subscription for that payment method & customerId
Is this a new integration?
Yse
Yes
My question is why that integration is working with test cards & not working with live cards? Any difference?
Please try to reply fast
I reply as soon as I have time.
Ok
Sources are deprecated, so we strongly discourage you from using it in new integrations. Please, use this guide: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
And see if the problem persists.
Why are you creating Sources then?
Ok