#aditya-parikh_api

1 messages ยท Page 1 of 1 (latest)

white finchBOT
#

๐Ÿ‘‹ 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.

rancid anvil
#

๐Ÿ‘‹ 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

ripe idol
#

I'm collecting payment method first but it is not giving me any error for 3DS

#

it is getting saved properly

opal needle
#

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 pass payment_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

ripe idol
#

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?

opal needle
#

Also, some example object IDs (e.g. sub_xxx) that demonstrate the behaviour you describe would really help here

ripe idol
#
customer.sources.create({
  source: stripe_token,
  metadata: {
    added_by: email
  }
})

sub_1Pl5QEBwapcz8n4LvKH8Nwqy

opal needle
#

Why are you using Sources? They're deprecated

opal needle
ripe idol
#

we are currently using very old API version "2015-02-18"

opal needle