#Shivam Kumar
1 messages · Page 1 of 1 (latest)
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
seti_1MWG5WJ3dxAQpMxWGQ7ORaGD
if($request->setup_intent_id){
$stripe->setupIntents->confirm(
$request->setup_intent_id
);
}
this error when i confirm setupIntents
What do you want to achieve exactly ? collecting and saving ACH Debit for a customer using Stripe Elements ?
yes this is my frontend code
var paymentIntent = response.paymentIntent;
stripe.collectBankAccountForSetup({
clientSecret : paymentIntent.client_secret,
params: {
payment_method_type: 'us_bank_account',
payment_method_data: {
billing_details: {name: 'Jenny Rosen', email: 'jenny@example.com'},
},
},
expand: ['payment_method'],
}) .then(({setupIntent, error}) => {
if (error) {
console.error(error.message);
// PaymentMethod collection failed for some reason.
} else if (setupIntent.status === 'requires_payment_method') {
console.log('cancel');
} else if (setupIntent.status === 'requires_confirmation') {
console.log("payment setup successfully");
console.log(setupIntent.id);
$.ajax({
url: '{{url('account/bank/addStripeBank')}}',
type: 'post',
data: { setup_intent_id: setupIntent.id },
headers: {
'X-CSRF-TOKEN': csrf_token,
},
})
}
});
Yes I see,
Are you following this guide step by step?
https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=web#web-collect-details
yes A to Z i follow this guide
Nice. In what step of the guide, it was mentioned to do like this? in order to be able to follow your issue
ok when i add bank then i want to confirm setup
else if (setupIntent.status === 'requires_confirmation') {
console.log("payment setup successfully");
console.log(setupIntent.id);
$.ajax({
url: '{{url('account/bank/addStripeBank')}}',
type: 'post',
data: { setup_intent_id: setupIntent.id },
headers: {
'X-CSRF-TOKEN': csrf_token,
},
})
using this code
i get setupIntent.id then i want add bank
i hit ajax run this function in backend
if($request->setup_intent_id){
$stripe->setupIntents->confirm(
$request->setup_intent_id
);
}
but i am getting this error "message": "Missing required param: mandate_data.",
please help me i don't find any solution for this error
Here you need to display the confirmationForm (confirmationForm.show();) as mentioned in the guide, because you didn't collect the mandate yet to be able to confirm the setup intent. Please follow the guide step by step till the end.
You should be at step 4, now:
https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=web#web-collect-details
remove that call, and continue collecting the mandate (step 5)
i am facing this error
Uncaught (in promise) TypeError: confirmationForm.show is not a function
var confirmationForm = document.getElementById('confirmation-form');
<div id="confirmation-form">
</div>
This is a Javascript error, like there is no element with that id in your DOM
i created this <div id="confirmation-form">
</div>
then why i am getting this error
You can refer to this sample project:
https://github.com/stripe-samples/accept-a-payment/blob/main/custom-payment-flow/client/html/ach.js
https://github.com/stripe-samples/accept-a-payment/blob/main/custom-payment-flow/client/html/ach.html
You can check how the confirmation form confirmation-form can be displayed