#AlienSoft

1 messages · Page 1 of 1 (latest)

sacred swallowBOT
sonic pagoda
#

👋 happy to help

#

would you mind sharing a PI ID example?

red wadi
#

Hello

sonic pagoda
#

taking a look

red wadi
#

All of a sudden EU payments with iDeal for example started coming back as: requires_payment_method

slender quartz
#

Can you share your code where you initialise the Payment Element please

red wadi
#

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"});

slender quartz
#

Can you also share your confirmPayment code?

red wadi
#

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

      })
slender quartz
red wadi
#

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 :/

slender quartz
#

As the confirmation call fails (because of cancel_url) the PI transitions to requires_payment_method

red wadi
#

so i thought i needed a cancel_url also

#

so we shouldn't have a cancel_url ?

slender quartz
#

Nope, users will always be returned to return_url regardless of success/failure

red wadi
#

ohh i see

slender quartz
#

Unlike Checkout, where there is success_url, cancel_url (maybe you've confused the 2)

red wadi
#

yes, i think so

sacred swallowBOT
slender quartz
#

All good! Hopefully that unblocks you

red wadi
#

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

slender quartz
#

Isn't that just a PHP header unrelated to Stripe? i.e. the redirect was a success, unrelated to the payment

red wadi
#

Yh

slender quartz
#

Or is it a URL parameter?

red wadi
#

But its checking the stripe result on post

slender quartz
#

Can you share the full URL that you land on (inc. parameters) after you cancel?

red wadi
#

I 'll just step away from pc for 10 mins. Then Ill be able to debug in a bit

slender quartz
#

I need to step away, but I'll leave you in @proud marlin's capable hands

proud marlin
#

Hi! I'm taking over my colleague. Please, let me know if you have any other questions.

proud marlin
#

Have you had a chance to check?