#siddarth_api

1 messages · Page 1 of 1 (latest)

valid bayBOT
#

👋 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/1311626682553077791

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

brave cradle
#

Hi, let me help you with this.

#

Microdeposit flow should start after the setup is confirmed. The customer will get an email with a link where they will be able to provide the microdeposit amounts to verify their bank account.

willow breach
#

then how do i make setup is confirmed before making a payment for us_bank_account type

#

below are my steps. Step1 - creating a setup intent and step2: using confirmBankSetup(), trying to complete the setup intent complete. but in this step2- the result is requires_action_ verify microdeposit

#

i am stuck here, how to create a setup intent for us_bank_account and make payment later in future

brave cradle
#

Are you working in Test mode right now?

willow breach
#

yes

brave cradle
#

Emails are not sent in Test mode, but they will be in Live mode. You can just use the URL available in the next_actions to provide the microdeposit amounts. Alternatively, you can use the Stripe.js, or backend API methods.

willow breach
#

how do I know the micordeposit amount? the set up is not complete right?

brave cradle
#

They should be visible in somewhere in Test mode, depending on your integration.
Could you please share the SetupIntent ID? seti_xxx

willow breach
#

give me few mins, will share it

willow breach
#

confirmUsBankAccountSetup - you must obtain authorization from your customer before you can initiate payment by displaying mandate terms for them to accept. How do I obtain this mandate?

#

When the customer accepts the mandate terms, you must confirm the SetupIntent. Use stripe.confirmUsBankAccountSetup to complete the payment when the customer submits the form. at this stage - the status is setupIntent.next_action?.type === "verify_with_microdeposits" in this state

#

and the payment is not done yet correct?

valid bayBOT
solemn moth
#

👋 taking over for my colleague. Let me catch up.

#

The easiest way to do what you want is just to use the PaymentElement

willow breach
#

my main question is, I am not using instant verification (since it goes through login to bank and other tings) . Can't I do setup intent and verify microdeposit in the same flow? if not when to do verify microdeposit?

solemn moth
#

you can

willow breach
#

let result = await stripe.confirmUsBankAccountSetup(
setupIntent.client_secret,
{
payment_method: {
us_bank_account: {
routing_number: routingNumber,
account_number: accountNumber,
account_holder_type: 'individual', // 'individual' or 'company'
},
billing_details: {
name: $('#tbFullName').val() || "",
email: $('#tbEmail').val(),
},
},
}
);

    if (result.error) {
         throw result.error;
    } else if (result.setupIntent.next_action?.type === "verify_with_microdeposits") {
         let microDepositResult = await stripe.verifyMicrodepositsForSetup(setupIntent.client_secret, {
            // Provide either a descriptor_code OR amounts, not both
            //descriptor_code: `SM11A`,
            //amounts: [32, 45],
        });
        if (microDepositResult.setupIntent.status === 'succeeded') {
            
            tokenizerResponse = result;
            tokenizerResponse.customer = setupIntent.customer;
        }
    }  this is my code, how can i do verifymicrodeposit immediately after the setup intent is created. provide any code samples
#

In these cases, Stripe sends a descriptor_code microdeposit and might fall back to an amount microdeposit if any further issues arise with verifying the bank account. These deposits take 1-2 business days to appear on the customer’s online statement. When will the stripe sends the code/amount? which steps strip will send ? at the time of setupintent create ? and if it takes 1-2 business days then how will I verify this code?

solemn moth
#

the 1-2 business days is for the customer to see that microdeposit on their bank account

#

If you supplied a billing email, Stripe notifies your customer via this email when the deposits are expected to arrive. The email includes a link to a Stripe-hosted verification page where they can confirm the amounts of the deposits and complete verification.

willow breach
#

I am really sorry for the confusion. going crazy here. In my above code I need to do verify microdeposit, how will I do,

solemn moth
#

When the bank account is successfully verified, Stripe returns the SetupIntent object with a status of succeeded, and sends a setup_intent.succeeded webhook event.

Verification can fail for several reasons. The failure may happen synchronously as a direct error response, or asynchronously through a setup_intent.setup_failed webhook event (shown in the following examples).

#

If you prefer not to use the Stripe-hosted verification page, create a form on your site. Your customers then use this form to relay microdeposit amounts to you and verify the bank account using Stripe.js.

willow breach
#

When the bank account is successfully verified? in which steps?

solemn moth
#

I think the confusion is around the fact that ACH DD is not a synchronous payment method and you want to treat it as such

willow breach
#

even if it is not syncronous, I want the setup intent to be completed atleast before making actual payment

#

forget about everything. I will say what I am looking for and what are my steps

#

Below are my code and steps, correct me if I am missing somethig here.

Step1: created customer and attached customer to setup intent. saving the customer and payment methods for later use in payment intent.

var options = new CustomerCreateOptions();
var service = new CustomerService();
var customer = await service.CreateAsync(options);

var setupIntentOptions = new SetupIntentCreateOptions
{
Customer = customer.Id,
PaymentMethodTypes = new List<string> { "us_bank_account" },
PaymentMethodOptions = new SetupIntentPaymentMethodOptionsOptions
{
UsBankAccount = new SetupIntentPaymentMethodOptionsUsBankAccountOptions
{
VerificationMethod = "microdeposits",//"instant", //"microdeposits"
FinancialConnections = new SetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsOptions
{
Permissions = new List<string> { "payment_method", "balances" },
},
},
},
};
var setupIntentService = new SetupIntentService();
var setupIntentResult = await setupIntentService.CreateAsync(setupIntentOptions);

#

step2: Making call to confirmUsBankAccountSetup by collecting the routing and account number.
let result = await stripe.confirmUsBankAccountSetup(
setupIntent.client_secret,
{
payment_method: {
us_bank_account: {
routing_number: routingNumber,
account_number: accountNumber,
account_holder_type: 'individual', // 'individual' or 'company'
},
billing_details: {
name: 'test',
email: $('#tbEmail').val(),
},
},
}
);

#

at this stage the setup intent is in setupIntent.next_action?.type === "verify_with_microdeposits"

solemn moth
#

your code just sets up the Payment Method and attach it to the customer

willow breach
#

I want to complete the setup intent at this stage

solemn moth
#

once the verification is finalized you will receive the setup_intent.succeeded event and then you would be able to use that payment to pay

willow breach
#

Yes, now how do I verify the setup intent is my question.

solemn moth
#

where you can build your own page to make them verify the microdeposit

willow breach
#

that means, it will not be immediately correct? I want this to happen instantly

solemn moth
#

but as you said since this might take 1 to 2 business days this can't be immediately completed

#

if you want instant verifications you can't use the microdeposit approach

#

that's what I was trying to tell you since yesterday

#

but it seems we're going round and round

willow breach
#

hmm now I understood, In that case we can not use microdeposit while setting up intent right?

solemn moth
#

you can but it won't be an instant verification

#

it would be asynchronous

willow breach
#

how can we do it this step?

solemn moth
#

and once the customer goes through the verification then you will receive the event

willow breach
#

this step is confusing, you are saying, we can use microdeposit while creating set up intent.

solemn moth
#

word by word, not just skim the content

solemn moth
#

you already have this setup

#

what are you expecting as a sample?

willow breach
#

code samples to complete the setupintent with microdeposit

solemn moth
#

you don't need to do anything

#

it's the customer that needs to do this

#

we (Stripe) will send them an email (if you pass their billing email) and once they see the microdeposit in their bank statement they would visit a Stripe hosted page and complete the microdeposit verification

willow breach
#

let result = await stripe.confirmUsBankAccountSetup(
setupIntent.client_secret,
{
payment_method: {
us_bank_account: {
routing_number: routingNumber,
account_number: accountNumber,
account_holder_type: 'individual', // 'individual' or 'company'
},
billing_details: {
name: $('#tbFullName').val() || "",
email: $('#tbEmail').val(),
},
},
}
);

    if (result.error) {
         throw result.error;
    } else if (result.setupIntent.next_action?.type === "verify_with_microdeposits") {
         let microDepositResult = await stripe.verifyMicrodepositsForSetup(setupIntent.client_secret, {
            // Provide either a descriptor_code OR amounts, not both
            //descriptor_code: `SM11A`,
            //amounts: [32, 45],
        });
        if (microDepositResult.setupIntent.status === 'succeeded') {
            
            tokenizerResponse = result;
            tokenizerResponse.customer = setupIntent.customer;
        }
    }  then I do not need to write this line of code is it else if (result.setupIntent.next_action?.type === "verify_with_microdeposits") {
         let microDepositResult = await stripe.verifyMicrodepositsForSetup(setupIntent.client_secret, {
            // Provide either a descriptor_code OR amounts, not both
            //descriptor_code: `SM11A`,
            //amounts: [32, 45],
        });
solemn moth
#

you don't need this, unless you're creating a page for your customer to verify that they received the microdeposit to replace the Stripe hosted page that we normally send them

if (result.error) {
             throw result.error;
        } else if (result.setupIntent.next_action?.type === "verify_with_microdeposits") {
             let microDepositResult = await stripe.verifyMicrodepositsForSetup(setupIntent.client_secret, {
                // Provide either a descriptor_code OR amounts, not both
                //descriptor_code: SM11A,
                //amounts: [32, 45],
            });
            if (microDepositResult.setupIntent.status === 'succeeded') {

                tokenizerResponse = result;
                tokenizerResponse.customer = setupIntent.customer;
            }
        }  then I do not need to write this line of code is it else if (result.setupIntent.next_action?.type === "verify_with_microdeposits") {
             let microDepositResult = await stripe.verifyMicrodepositsForSetup(setupIntent.client_secret, {
                // Provide either a descriptor_code OR amounts, not both
                //descriptor_code: SM11A,
                //amounts: [32, 45],
            });
willow breach
#

that sending an email to cutomer is offline process not from our application correct? and when the customer verifies it opening the link then only the status will be updated in your server as Succedded or completed. until then I will not be able to make payment with that stored payment method?

solemn moth
#

that sending an email to cutomer is offline process not from our application correct?
correct

#

and when the customer verifies it opening the link then only the status will be updated in your server as Succedded or completed.
correct you will receive a webhook event