#AlienSoft
1 messages · Page 1 of 1 (latest)
Hello
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
taking a look
All of a sudden EU payments with iDeal for example started coming back as: requires_payment_method
Can you share your code where you initialise the Payment Element please
async function initialize() {
const options = {
mode: 'payment',
amount: 12500,
currency: 'gbp',
// Fully customizable with appearance API.
appearance: {/.../},
};
//elements.update({locale: 'fr'});
// Set up Stripe.js and Elements to use in checkout form
elements = stripe.elements(options);
//const linkAuthenticationElement = elements.create("linkAuthentication");
//linkAuthenticationElement.mount("#link-authentication-element");
const paymentElementOptions = {
layout: "tabs",
paymentMethodOrder: ['card', 'iDeal', 'Alipay', 'wechat_pay'],
fields: {
billingDetails: {
name: "auto",
email: "never",
address: {
country: 'never',
postalCode: 'never'
}
}
}
};
paymentElement = elements.create("payment", paymentElementOptions);
paymentElement.mount("#payment-element");
}
this is initialized in GBP. so when currency changes i have an: elements.update({currency: "eur"});
Can you also share your confirmPayment code?
stripe.confirmPayment({
clientSecret,
elements,
confirmParams: {
return_url: window.location.href,
cancel_url: window.location.href,
receipt_email: email[0],
//description: email[0] + ' : ' + countryName,
payment_method_data: {
billing_details: {
name: clientName,
email: email[0],
address: {
city: city,
country: country,
line1: street,
line2: "",
state: "",
postal_code: postCode
}
}
}
},
redirect: 'if_required' //if_required
})
Yeah, the issue is that cancel_url parameter: https://dashboard.stripe.com/test/logs/req_WvtdaVXI9u5JZh
It's invalid, so you should omit. Out of interest, where have you seen that referenced?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
aha! i did have a suspicion it could be the cancel url
because when I failed the TEST Payment earlier, it still triggered the succeeded and redirected :/
As the confirmation call fails (because of cancel_url) the PI transitions to requires_payment_method
Nope, users will always be returned to return_url regardless of success/failure
ohh i see
Unlike Checkout, where there is success_url, cancel_url (maybe you've confused the 2)
yes, i think so
All good! Hopefully that unblocks you
ok thanks. but something strange is happening though. now no errors but, when i CANCEL the test page to fail the payment when it redirects to my url on my top php page i have
if (isset($_GET['redirect_status'])){
if ($_GET['redirect_status'] = 'succeeded'){
echo "Redirecting...";
header('Location: ' . '../../machineid/v4');
exit();
}
}
now should only redirecting if redirect_status = succeeded.... why is it still redirecting me ?
shouldn't redirect_status be returning cancelled or something
i guess i'll have to debug this
Isn't that just a PHP header unrelated to Stripe? i.e. the redirect was a success, unrelated to the payment
Yh
Or is it a URL parameter?
But its checking the stripe result on post
Can you share the full URL that you land on (inc. parameters) after you cancel?
I 'll just step away from pc for 10 mins. Then Ill be able to debug in a bit
I need to step away, but I'll leave you in @proud marlin's capable hands
Hi! I'm taking over my colleague. Please, let me know if you have any other questions.
Have you had a chance to check?