#aditya-parikh_api
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/1270668969077899305
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ happy to help
you can follow this flow
to collect the payment method first and then create the subscription afterwards
but that doesn't mean that 3DS might not be required
I'm collecting payment method first but it is not giving me any error for 3DS
it is getting saved properly
How are you collecting/saving the payment method?
it goes through by putting subscription and payment to "Incomplete" and Invoice to "open". How do I not create subscription at all in this scenario?
It'd depend on how you're creating the Subscription, but generally you can passpayment_behavior: 'error_if_incomplete'if you want to prevent subscription creation when payment fails on a pre-saved card: https://docs.stripe.com/api/subscriptions/create?lang=ruby#create_subscription-payment_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I am creating the card first and using that card to create subscription
in production environment some how it is working as expected but for testing purpose we have a separate stripe account where it is not working
in production account, no subscription and invoices are created if 3DS failure happens while payment
but in test account it happens
is there any settings I need to modify?
As asked, can you share details on how you're creating the card?
Also, some example object IDs (e.g. sub_xxx) that demonstrate the behaviour you describe would really help here
customer.sources.create({
source: stripe_token,
metadata: {
added_by: email
}
})
sub_1Pl5QEBwapcz8n4LvKH8Nwqy
Why are you using Sources? They're deprecated
In any case, if you want the POST /v1/subscriptions call to fail when 3DS/auth is requested, then you need to pass payment_behaviour: 'error_if_incomplete on creation as advised
we are currently using very old API version "2015-02-18"
API version is irrelevant really. The Payment Methods API is backwards compatible: https://docs.stripe.com/payments/payment-methods/transitioning