#bit - confirm sepa
1 messages ยท Page 1 of 1 (latest)
sure ๐ I'll write down the problem in the meanwhile, take all the time you need, and thanks in advance for your help
Yea, and please share the request ID where you get the error
https://stripe.com/docs/api/request_ids
eg req_123
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
pi_3KZU3BDdn72I1qqY2o0lOhdK
const listener = async event => {
// Show a loading screen...
showSpinning();
event.preventDefault();
stripe.createPaymentMethod({
type: 'sepa_debit',
sepa_debit: elements.getElement('iban'),
billing_details: {
name: document.getElementById("name-element").value,
email: document.getElementById("email-element").value,
}
}).then(function (result) {
if (result.error) {
showFancyError('Errore - il pagamento non รจ stato effettuato!', result.error.message);
} else {
if (result.paymentMethod) {
if (result.paymentMethod.sepa_debit && result.paymentMethod.sepa_debit.bank_code
&& result.paymentMethod.sepa_debit.bank_code == '02008') {
showNoUnicreditPlease();
return;
}
else
confirmPayment(result.paymentMethod);
}
}
})
}
function confirmPayment(paymentMethod) {
stripe.confirmSepaDebitPayment('<%=ClientSecret%>', {
payment_method: paymentMethod
}).then(function (result) {
hideSpinning();
if (result.error || result.paymentIntent.status === 'payment_failed') {
showFancyError('Errore - il pagamento non รจ stato effettuato!', result.error.message);
} else {
if (result.paymentIntent.status === 'succeeded' || result.paymentIntent.status === 'processing') {
showSuccessTransaction();
}
else
alert('result.paymentintent.status pagamento NON effettuato - errore status sconosciuto: ' + result.paymentIntent.status);
}
});
}
form.addEventListener('submit', listener);
sorry it has some text in italian
mainly, I create a paymentMethod, I check for some bank codes I don't want to accept, and this works... so I get the paymentMethod correctly
then I pass the paymentMethod as a parameter to my "confirmPayment" function
Whats the actual request/ error you encounter? In which part of this?
when I send the stripe.confirmSepaDebitPayment
I use the "paymentMethod" I took from the parameter of the function
and the result is the one you can see in the paymentIntent above
so the problem is in the confirmPayment function, I suppose
the api answer is:
Which lines exactly are you referring to? I only see the confirmation with the elements.get(iban). Is there another one?
It sounds like you have a version with an existing payment method being provided
in which case you'd only send the ID, not the object
ahhhhhhhhhhh
eg payment_method: 'pm_123'
Can you share teh actual request ID from the network?
maybe I found the problem
req_uKaIfkv8K7sqKZ
the payment_intent is on "processing"
my fault
Yes it looks like you're trying to confirm the same payment again, you need to use a new one to test this
๐