#awo_ece-confirm
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1440364765565423676
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there, can you give me an example Payment Intent ID (pi_1234) that you're experiencing this problem with?
pi_3SUqX0FSXSPNg8P81thmep7c
are you calling stripe.confirmPayPalPayment() as described here? https://docs.stripe.com/payments/paypal/accept-a-payment?payment-ui=direct-api#confirm-paypal-payment
i use the whole express checkout element, do i have to make that seperate for every possible payment option (klarna, paypal, ..) ? my compaarable code looks like this ``` const { error } = await stripe.confirmPayment({
clientSecret: clientSecret,
confirmParams: {
shipping: {
name: shippingAddress.name,
address: {
line1: shippingAddress.address.line1,
city: shippingAddress.address.city,
country: shippingAddress.address.country,
postal_code: shippingAddress.address.postalCode,
state: shippingAddress.address.state,
}
},
return_url: ${window.location.origin}/complete,
},
});
if (error) {
setMessage(`Zahlungsfehler nach Bestätigung: ${error.message}`);
} else {
setMessage("Zahlung initiiert. Wenn kein Fenster geöffnet wurde, ist die Weiterleitung blockiert.");
}```
yes, Klarna has a similar method called stripe.confirmKlarnaPayment()
i tried like this but it gives me same result
can you share the part of your code that is calling stripe.confirmPayPalPayment() ?
const handleExpressCheckoutConfirm = async ({ paymentMethod, shippingAddress, shippingRate }) => {
setIsLoading(true);
setMessage(null);
if (!clientSecret) {
setMessage("Error: Client Secret fehlt. Bitte die Warenkorbseite neu laden.");
setIsLoading(false);
return;
}
if (!stripe || !elements) {
setMessage("Error: Stripe/Elements nicht initialisiert.");
setIsLoading(false);
return;
}
if (!paymentMethod || paymentMethod.type !== 'paypal') {
setMessage("Error: PayPal Zahlungsmethode wurde nicht korrekt bereitgestellt.");
setIsLoading(false);
return;
}
const {error} = await stripe.confirmPayPalPayment(
'{{PAYMENT_INTENT_CLIENT_SECRET}}',
{
return_url: `${window.location.origin}/complete`,
}
);
if (error) {
setMessage(`Zahlungsfehler nach Bestätigung: ${error.message}`);
} else {
setMessage("Zahlung initiiert. Wenn kein Fenster geöffnet wurde, ist die Weiterleitung blockiert.");
}
setIsLoading(false);
};```
you need to change '{{PAYMENT_INTENT_CLIENT_SECRET}}' to pass in the client secret from the Payment Intent creation
still no redirect
const {error} = await stripe.confirmPayPalPayment(
clientSecret,
{
return_url: `${window.location.origin}/complete`,
}
);```
any errors in your console? or output from that setMessage() function?
no
have you confirmed that stripe.confirmPayPalPayment() is actually getting called? try adding some console logs around it just to make sure the code is progressing to that point
console.log('1')
// 1. LOGIK FÜR EXPRESS CHECKOUT
const handleExpressCheckoutConfirm = async ({ paymentMethod, shippingAddress, shippingRate }) => {
console.log('2')
setIsLoading(true);
setMessage(null);
if (!clientSecret) {
setMessage("Error: Client Secret fehlt. Bitte die Warenkorbseite neu laden.");
setIsLoading(false);
return;
}
if (!stripe || !elements) {
setMessage("Error: Stripe/Elements nicht initialisiert.");
setIsLoading(false);
return;
}
if (!paymentMethod || paymentMethod.type !== 'paypal') {
setMessage("Error: PayPal Zahlungsmethode wurde nicht korrekt bereitgestellt.");
setIsLoading(false);
return;
}
const {error} = await stripe.confirmPayPalPayment(
clientSecret,
{
return_url: `${window.location.origin}/complete`,
},
console.log('3')
);
if (error) {
setMessage(`Zahlungsfehler nach Bestätigung: ${error.message}`);
} else {
setMessage("Zahlung initiiert. Wenn kein Fenster geöffnet wurde, ist die Weiterleitung blockiert.");
}
setIsLoading(false);
};
``` console log 1 gets called three times, console log 2 only one time when i enter my paypal details and log 3 doesnt show at all
👋 Taking over this thread, catching up now
Sorry for the confusion. For Express Checkout Element, stripe.confirmPayment() should work for all the supported wallet payment methods. You shouldn't need to integrate the payment method individually.
when i use expresscheckoutelement and enter my correct sandbox information in the paypal window, it closes, but keeps my site on freeze and tells me to proceed with my payment in the open paypal window or use another method.
Could you share the full code of which you integrate the Express Checkout Element with the onConfirm handler,handleExpressCheckoutConfirm?
Are you following this guide for your Express Checkout Element integration? https://docs.stripe.com/elements/express-checkout-element/accept-a-payment?payment-ui=elements
Express Checkout Element uses deferred intent flow, which you'd need to set the payment amount and currency in the options of Elements. There are some configurations that aren't set up correctly:
- The
elementsOptionsshouldmode,currencyandamount: https://docs.stripe.com/elements/express-checkout-element/accept-a-payment?payment-ui=elements#set-up-elements clientSecretshouldn't be setelementsOptions
Could you try if this will fix the issue?
still have the issue, ```
// CHANGED THIS
// const elementsOptions = {
// clientSecret: clientSecret,
// appearance: appearance,
// };
// TO THAT
const elementsOptions = {
mode: 'payment',
amount: 2000,
currency: 'usd',
appearance: appearance,
};```
Could you share your development website, so that I can take a look what actually happens?
awo_ece-confirm