#tenacious_tiger_75633
1 messages · Page 1 of 1 (latest)
hi, what's your exact question?
I got proccessing error occured payment error during mx transfer.but in stripe account payment succeded.i used testmode stripe account
shared-e1133505b39293c441dd04cf4a35b2d7.js:1 POST https://api.stripe.com/v1/payment_intents/pi_3Nd7fcLxCkdFCCzr0HHTctRB/confirm 400
(anonymous) @ shared-e1133505b39293c441dd04cf4a35b2d7.js:1
e @ shared-e1133505b39293c441dd04cf4a35b2d7.js:1
c @ shared-e1133505b39293c441dd04cf4a35b2d7.js:1
s @ shared-e1133505b39293c441dd04cf4a35b2d7.js:1
e @ shared-e1133505b39293c441dd04cf4a35b2d7.js:1
gs @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
(anonymous) @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
Promise.then (async)
confirmPaymentIntent @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
(anonymous) @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
(anonymous) @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
Promise.then (async)
value @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
handleAction @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
value @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
(anonymous) @ controller-837bf6fe13306dafe2716fb7a9f266ba.js:1
in the console above error displayed
will have a look soon
the PaymentIntent already succeeded when you created it on the backend(https://dashboard.stripe.com/test/logs/req_obq0hSMO2kqkJZ) , so it didn't need to be confirmed again on the frontend, so that errored
<script>
document.addEventListener('DOMContentLoaded', async () => {
const stripe = Stripe('pk_test_xxxxxxxxx'); // Replace with your actual publishable key
const elements = stripe.elements({
clientSecret: '<?= $paymentIntent->client_secret; ?>',
hidePostalCode: true
});
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
const paymentForm = document.querySelector('#payment-form');
paymentForm.addEventListener('submit', async (e) => {
// Avoid a full page POST request.
e.preventDefault();
// Disable the form from submitting twice.
paymentForm.querySelector('button').disabled = true;
// Confirm the card payment that was created server side:
const {error} = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: '<?= base_url() ?>cards/complete' // Replace with your actual return URL
}
});
if(error) {
addMessage(error.message);
// Re-enable the form so the customer can resubmit.
paymentForm.querySelector('button').disabled = false;
return;
}
});
});
</script>
i used same script for card,oxxo and transfer.card and oxxo it works fine but in transfer i got error.how to change this ?
check on the backend the status of the PaymentIntent after you create it, and treat it differently if it is succeeded