#jatinpatel0708
1 messages · Page 1 of 1 (latest)
have you confirmed the payment? https://stripe.com/docs/js/payment_intents/confirm_payment
or https://stripe.com/docs/api/payment_intents/confirm if you're doing it via your server
paymentMethodForm.addEventListener('submit', (ev) => {
ev.preventDefault();
const accountHolderNameField = document.getElementById('account-holder-name-field');
const emailField = document.getElementById('email-field');
var posting = [];
posting.push({name: 'name', value: accountHolderNameField});
posting.push({name: 'email',value: emailField });
$.ajax({
type: 'POST',
url: "{{ route('create.bank.payment.intent') }}",
data: posting,
success: function (response) {
console.log(response);
const clientSecret = response.data.client_secret;
console.log(clientSecret);
// Calling this method will open the instant verification dialog.
stripe.collectBankAccountForPayment({
clientSecret: clientSecret,
params: {
payment_method_type: 'us_bank_account',
payment_method_data: {
billing_details: {
name: accountHolderNameField.value,
email: emailField.value,
},
},
},
expand: ['payment_method'],
})
.then(({paymentIntent, error}) => {
if (error) {
console.error(error.message);
} else if (paymentIntent.status === 'requires_payment_method') {
} else if (paymentIntent.status === 'requires_confirmation') {
console.log('require confirm');
}
});
} });
});
here is my code where I need to confirm payment intent, server side or client side?
you're probably following this guide : https://stripe.com/docs/payments/ach-debit/accept-a-payment - if that's the case, you'll want to see this section on how to confirm the payment : https://stripe.com/docs/payments/ach-debit/accept-a-payment?platform=web&ui=API#web-collect-mandate-and-submit
it means I need to replace this code
stripe.collectBankAccountForPayment({
clientSecret: clientSecret,
params: {
payment_method_type: 'us_bank_account',
payment_method_data: {
billing_details: {
name: accountHolderNameField.value,
email: emailField.value,
},
},
},
expand: ['payment_method'],
})
.then(({paymentIntent, error}) => {
if (error) {
console.error(error.message);
} else if (paymentIntent.status === 'requires_payment_method') {
} else if (paymentIntent.status === 'requires_confirmation') {
console.log('require confirm');
}
});
============to ==================
confirmationForm.addEventListener('submit', (ev) => {
ev.preventDefault();
stripe.confirmUsBankAccountPayment(clientSecret)
.then(({paymentIntent, error}) => {
if (error) {
console.error(error.message);
// The payment failed for some reason.
} else if (paymentIntent.status === "requires_payment_method") {
// Confirmation failed. Attempt again with a different payment method.
} else if (paymentIntent.status === "processing") {
// Confirmation succeeded! The account will be debited.
// Display a message to customer.
} else if (paymentIntent.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).
}
});
});
you shouldn't replace the code - it's an addition
okay, Thanks where I need to add it please let me know
Hi @celest lotus , I'm taking over. Let me know if you have any follow-up questions.
I am trying to integrate an ACH direct debit
but i am getting the status is "requires_confirmation",
i have already sent a code
Do you have the PaymentIntent ID?
here is payment intent id
pi_3N8FMvGbE4TMTQU01pdc03oI
now i am getting the payment status is pending
It's already succeeded
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
yes, after sometimes is confirm the payment,
why is not confirm instance
ACH is a delayed payment method, so the payment can't be confirmed instantly.