#MDTOHM
1 messages · Page 1 of 1 (latest)
stripe.collectBankAccountForSetup({
clientSecret: result.financial_connection_response.client_secret,
params: {
payment_method_type: 'us_bank_account',
payment_method_data: {
billing_details: {
name: customerName,
email: result.customer.email
},
},
},
expand: ['payment_method'],
})
.then(({setupIntent, error}) => {
if (error) {
console.error(error.message);
} else if (setupIntent.status === 'requires_payment_method') {
} else if (setupIntent.status === 'requires_confirmation') {
** stripe = new \Stripe\StripeClient(stripe_api_key);
stripe->customers->createSource(
'cus_LKrdF3pg9lAgVZ',
['source' => setupIntent.payment_method.us_bank_account.financial_connections_account]
);**
}
BOLD - Where I assume this call could be made (cus_LKrdF3pg9lAgVZ ... would be replaced with the customers stripe ID of course
This collection is meant to be run using the client_secret of a Setup Intent you create associated with a customer:
https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=web#web-collect-details
The Sources API is not use for this with the latest integration pattern (in that doc)
Yes thats the code I'm referring to
I just snipped out the "collectBankAccountForSetup" part
But in the above documentation URL - There is no mention of how to actually STORE the users accounts
Putting the system into production, I can console out the "setupIntent" and see the response as expected .... but it doesn't SAVE to the Customer's object within Stripe
So I assumed there was some other call in this mix, to actually STORE the account
Once you finish that flow, it should already be attached to the customer you provided for the setup intent
I read through to step 5 (https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=web#web-collect-mandate-and-submit)
but since we're using Instant Verify .... do we need to do this ?
You can retrieve that from the customer and use it for payments in future:
https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=web#web-future-payments
Yes, after we complete the flow....we're UNABLE to get the customers account in this method....as its never actually SAVES/STORED in Stripe
from the end of step 4:
When your customer completes the authentication flow, the PaymentMethod automatically attaches to the SetupIntent, and a Financial Connections account is created.
yeah ....odd....not happening
Can you share an example setup intent?
The code (above) or ?
How about this
Here is a bank account that I verified yesterday
Customer ID - cus_MfnuNFHPZceBLo
That's a customer, can you share the actual setup intent id? seti_123
I have the financial id
I didnt log the setup intent id
One second, I'll run it again and log
I'm looking at the one you made most recetnly in test mode
Hmm looks like it wasn't confirmed
Right
So it hits this status - } else if (setupIntent.status === 'requires_confirmation') {
You do need to take that last confirmation step after the bank details are collected
Step 5 is to prompt the user with a CONFIRM form
Yes, you need to do Step 5 then
Sample code for what?
There's a snippet in Step 5 showing the Stripe.js call
and below there are example mandate text you can use
Note that if you use the payment element, this does already include our suggested mandate text
Sorry, but isnt' this (below) just the event listener for some type of FORM (confirmation form) ? and the callbacks ?
confirmationForm.addEventListener('submit', (ev) => {
ev.preventDefault();
stripe.confirmUsBankAccountSetup(clientSecret)
.then(({setupIntent, error}) => {
if (error) {
console.error(error.message);
// The payment failed for some reason.
} else if (setupIntent.status === "requires_payment_method") {
// Confirmation failed. Attempt again with a different payment method.
} else if (setupIntent.status === "succeeded") {
// Confirmation succeeded! The account is now saved.
// Display a message to customer.
} else if (setupIntent.next_action?.type === "verify_with_microdeposits") {
// The account needs to be verified via microdeposits.
// Display a message to consumer with next steps (consumer waits for
// microdeposits, then enters a statement descriptor code on a page sent to them via email).
}
});
});
I meant is there an example of the FORM that would be displayed/used to prompt the user to actually CONFIRM
"Click here to confirm...." Submit
That's up to you, and for test mode you can just call the confirmation method directly
Yep, looks like its succeeded and theres a payment method attached to the customer
Yes sir!!! Thank you very much
ok so, the id "setupIntent.id"
is what I'd use to CALL this account, correct ?
You can retrieve that from the customer and use it for payments in future:
https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=web#web-future-payments
As looking in the portal I see "Manadate ID" / "Fingerprint" and an "ID" (starting with "pm_
\
Yea, you use the pm_123 with those future payment intents