#swe_api

1 messages ยท Page 1 of 1 (latest)

tawdry wigeonBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

viral smelt
twin scaffold
viral smelt
#

Yes, I tried creating setup intent using the above account numbers.

twin scaffold
#

Ah, right, these only work for Payment Intents. What specific thing are you trying to test with a Setup Intent?

viral smelt
#

I am trying to test different scenarios where - bank takes more time to respond in setup intent processing, the bank account entered by the customer isn't active. Basically all scenarios, that applies for payment intent when the customer adds the bank account for the first time.

twin scaffold
#

To clarify, Setup Intents with SEPA will never be in a processing state, nor will they have a delay.

viral smelt
#

Okay? What are the chances that setup intent request might fail?

twin scaffold
#

A Setup Intent for SEPA only creates a Payment Method and a Mandate. I can't think of a reason it would ever fail, really, beyond basic stuff like no required account info provided or something like that.

#

Other Setup Intents can move to processing, but not for SEPA.

viral smelt
#

How about other statuses?
requires_payment_method, requires_action?

#

Could you let us know - out of all the status in setup intent, what are the applicable statuses for SEPA?
If we have the mandate, does that mean that the payment method is valid?

twin scaffold
#

requires_payment_method would be the state of a brand new Setup Intent without payment details yet, so that would apply, but would happen first.

viral smelt
#

but would happen first. - May I know what do you mean by this?

twin scaffold
#

First as in when you create the Setup Intent, assuming you don't provide payment info initially.

viral smelt
#

curl --location 'https://api.stripe.com/v1/setup_intents'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: Basic <api-key>'
--data-urlencode 'customer=cus_R4TJlaWd2hCI67'
--data-urlencode 'payment_method_types%5B%5D=sepa_debit'
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Btype%5D=online'
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Baccepted_at%5D=1680626716'
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Bonline%5D%5Bip_address%5D=223.196.170.31'
--data-urlencode 'mandate_data%5Bcustomer_acceptance%5D%5Bonline%5D%5Buser_agent%5D=mozilla'
--data-urlencode 'confirm=true'
--data-urlencode 'payment_method_data%5Bsepa_debit%5D%5Biban%5D=AT321904300235473204'
--data-urlencode 'payment_method_data%5Btype%5D=sepa_debit'
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bname%5D=test'
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bemail%5D=test@abc.com'

twin scaffold
#

Really the best way to know how this works is to try it in test mode.

viral smelt
#

We are doing confirm and create setup intent in a single step. In sandbox, whatever account number I try, it always returns succeeded setup intent.

twin scaffold
#

Yeah, that makes sense. You're supplying all of the required information up front, including the payment details, so the Setup Intent is instantly creating a Payment Method from that info and, thus, isn't ever going into requires_payment_method status.

viral smelt
#

Yes, exactly.

#

In case of payment intent flow, it goes to requires_payment_method for specific scenarios, and that's what confuses us.
requires_payment_method in payment intent might mean that the bank has rejected the payment? ๐Ÿค”

twin scaffold
#

Yeah, if a Payment Intent confirmation attempt fails it will usually detach the Payment Method that failed and go into requires_payment_method status as a result.

#

But that doesn't apply to SEPA Setup Intents because there is no payment involved to fail.

viral smelt
#

Is it possible that the setup intent which is in succeeded status has a payment method, and that payment method fails at a later point when used in payment intents API?

twin scaffold
#

Yes, of course. There's no way to guarantee any future payment will succeed. The account might have insufficent funds when you try to make the payment. The account might be closed at that point. Lost of reasons it can fail.

viral smelt
#

What does setup intent mean actually here? Do you make a call to the bank and do verification? May I know what happens behind the screen?

#

"Yes, of course. There's no way to guarantee any future payment will succeed. The account might have insufficent funds when you try to make the payment. The account might be closed at that point. Lost of reasons it can fail."
-- These failures are acceptable and can be rectified by contacting the bank. Any other errors you envision?

twin scaffold
#

Using a Setup Intent for SEPA creates a SEPA Payment Method with a Mandate you can attach to a Customer and reuse later.

viral smelt
#

Yes, that's what happens for us. But, does it do any processing at the bank?

twin scaffold
#

There are a ton of possible failure modes for any payment, it's not practical to list them all here.

#

I don't believe a SEPA Setup Intent will contact the bank in the scenario you're describing.

viral smelt
#

Got it. For now, it's safe to assume that
Setup intent with confirmation - if returns success can have a valid payment method. Setup intent will not go to processing unlike payment intent or like cards.

twin scaffold
#

Correct.

viral smelt
#

Thank you so much, this helps a lot. Could you add this to the documentation, so that we don't get confusion during implementation?

twin scaffold
#

I will flag a docs update for this internally, yep.

viral smelt
#

I had asked earlier in discord, and I was told that this was an issue with the test account numbers.

twin scaffold
#

There was probably some confusion about those test account numbers only applying to Payment Intents. Sorry about that.

tawdry wigeonBOT
viral smelt
#

Thank you so much for providing this level of clarity. If there were an option to rate this conversation, I would rate 10 on 5. Appreciate it.

twin scaffold
#

Happy to help!