#Arvind hariharan

1 messages · Page 1 of 1 (latest)

weary mistBOT
fair barn
#

yep, we know, we've been talking about it for weeks with you now 🙂

#

so what's the next question?

weary mistBOT
topaz grove
#

Hi

#

I have been writing integration test cases for stripe ACH instant and micro deposit verification

#

i was able to succesfully write the test case for Micro deposit flow

#

But i am not able to get the Instant Verification flow process to be successful when i am setting the payment method type as us_bank_account

#

Alternatively i tried setting the verification method as INSTANT in the payment method options

waxen harbor
#

What does a failure look like? Is there an error?

topaz grove
#

yes

#

let me send over that

#

this is the error i get

#

i cannot set both payment method as us_bank_account and use instant verification

#

can you please help out here

#

Cos if i dont set payment method then i am not able to confirm the payment intent

#

or if i only set payment method and do not set instant verification, then it doesnt take me through the instant verification flow and my confirm payment intent status is changed always to requires_action state

#

and treats it as microdeposit flow

#

so wanted to understand what excatly i must be doing

waxen harbor
topaz grove
#

request-id: req_mbNeTreBlKxuGy

#

I hope u got my issue?

#

you there/

#

?

waxen harbor
#

I am, please be patient

topaz grove
#

ok sure

waxen harbor
#

Why are you confirming server-side? You should be calling confirmUsBankAccountPayment in your front-end

topaz grove
#

we have already integrated our code to confirm it server side and the code is working fine

#

we are able to confirm the payment intent

waxen harbor
#

Clearly not as the error you shared is from that code

topaz grove
#

this code is getting called from our test class

waxen harbor
#

You can't confirm server-side in the instant verifications flow, you need to call the Stripe.js method I shared to initialise the bank account selection/verification

topaz grove
#

so from server side even if i set the payment method as us_bank_account and create the payment intent, while confirming it would go thorugh the micro deposit flow only is it ?

#

only when we collect the bank account details from client side we get the instant verification flow and while confirming the payment intent it chnages the state to processing?

waxen harbor
#

I believe so yes

topaz grove
#

ok so i can only test the micro deposit flow from my integration test class dynamically . And for instant verification i need to mock the confirm payment response and assert?

#

is my understanding right

#

?

waxen harbor
#

Yes seems about right. But you probably won't be able to test the instant verification flow. We just recommend that you stub/mock responses from the API

topaz grove
#

okay fine

#

Also with the test account numbers i cannot create a payment method and test it is it?

#

dynamically

waxen harbor
#

What specifically do you want to test?

topaz grove
#

instant verification from my integration test class

waxen harbor
#

You can't automate instant verification testing no as it requires user interaction (i.e. you present the UI to them, and then connect with their bank and select the deposit account)

topaz grove
#

okay then just trying ti understand on this piece in the doc

#

I am trying to use this code

waxen harbor
#

What about it?

topaz grove
#

Cant we set this verification method to instant while creating payment intent?

#

but only issue is here in this code they are not setting payment method

#

and thats y the confirm payment intent fails

#

so wanted to know, i cannot take this route as well?

waxen harbor
#

That link you sent is just a way to only allow instant verification

topaz grove
#

hmm okay so for instant as you said we need to mock the payment intent confirm call

#

since its tightly coupled with front end

#

unlike micro deposit where i am able to test it dynamically by creating a payment method in the code

waxen harbor
#

Our general recommendation is to just not test these UI payment flows (like instant verification)

topaz grove
#

i did not get you?

waxen harbor
#

I'm not sure how you expect to automate an instant verification test when it requires user interaction

#

So, you just don't

#

And instead you mock responses from our API that simulate the scenarios you want to test

topaz grove
#

yeah okay got it thanks