#wedfoo_code

1 messages ยท Page 1 of 1 (latest)

atomic basinBOT
#

๐Ÿ‘‹ 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/1304054290272358422

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

static warren
#

hi there!

#

can you share a PaymentIntent ID (pi_xxx) with this issue?

pliant loom
#

Hi soma!

#

pi_3QIU6qAp5kugdp2K0UUBEQE3

#

I arrive at this point and the process stuck here

static warren
pliant loom
#

can you give me a moment, I think I can replicate it in test environment, I just need a moment to create the account on amazon

#

Sorry to keep you waiting, my colleague is coming to take the test

static warren
#

no worries

pliant loom
#

pi_3QIUyaAp5kugdp2K1FYn3wQ3

static warren
#

and with that PaymentIntent you get the exact same issue as before, with the "processing payment" error on amazon website?

pliant loom
#

yes, I mean I don't see error in creation of the intent, I can click the button on elements express checkout, I can sign in into amazon, press the button of the payment and see the screenshot I shared with you

static warren
#

and if you wait a little, the page continues saying "processing payment..." indefinitely?

pliant loom
#

yes exactly

#

production tried with 2 different amazon account

#

and test, 1 time

#

If I refrest the page I still have the same problem

static warren
#

and if you use your Express Checkout button to pay with another payment method, it works as expected?

pliant loom
#

Let me try, this page was created only for amazon pay

#

pi_3QIVKpAp5kugdp2K1IvBjqgd

#

same error, timeout

static warren
#

same error with Google Pay? so it means there's an issue with your integration. can you share your Checkout Element code?

pliant loom
#

we press pay but it doesn't work, timeout error (with google)

        $payment_options = array(
            'amount'              => $result[0]['payment_amount'] * 100,           //importo in centesimi
            'currency'            => strtolower($result[0]['payment_currency']),
            'description'         => $result[0]['payment_description'],
            'capture_method'      => $method,
            'payment_method_types' => ['amazon_pay'],  // Aggiungi questa riga
            'metadata' => [
                'custom' => $post_data['custom'],
            ]
        );

        $paymentIntent = \Stripe\PaymentIntent::create([
            $payment_options
        ]);

        $output = [
            'clientSecret' => $paymentIntent->client_secret,
        ];
#

$method can be 'automatic' or 'manual'

static warren
#

can you share the frontend code?

#

also do you get an errors in the browser console?

pliant loom
#

function getClientSecret() {

            return $.ajax({
                url: '/mobile_amazon',
                type: 'POST',
                data: {
                    req: 'ajax',
                    token: '{param_token}',
                    intent: '{param_intent}'
                },
                dataType: 'json'
            }).then(function(response) {
                if (response.client_secret || response.clientSecret) {
                    return response.client_secret || response.clientSecret;
                } else {
                    throw new Error('No client secret found in response');
                }
            }).catch(function(error) {
                throw error;
            });
        }
#

async function initializeStripe(clientSecret) {
try {

                var locale = getCookie('lang').substr(0, 2) || 'en';

                elements = stripe.elements({
                    locale: locale,
                    appearance: appearance,
                    clientSecret: clientSecret
                });


                paymentElement = elements.create('payment', {
                    layout: 'accordion', ...paymentElementOptions});
                paymentElement.mount('#payment-element');
                expressCheckoutElement = elements.create('expressCheckout', expressCheckoutOptions);
                expressCheckoutElement.mount('#express-checkout-element');

                
                const loadingOverlay = document.getElementById('loading-overlay');
                const mainContent = document.getElementById('main-content');
                
                setTimeout(() => {
                                loadingOverlay.classList.add('fade-out');
                                mainContent.classList.add('visible');
                                mainContent.style.opacity = '1';
                                mainContent.style.display = 'block';
                                paymentElement.style.display = 'block';
                                // submitButton.style.display = 'block';
                            }, 2500);


                // paymentElement.on('change', (event) => {
                //     submitButton.disabled = !event.complete;
                // });

                // submitButton.addEventListener("click", handleSubmit);
                expressCheckoutElement.on('confirm', handleExpressCheckoutConfirmation);

            } catch (error) {
                showMessage("{lang_payment_initialization_error}");
            }
        }
static warren
#

actually, do you have a link where I can reproduce the issue? that might be simpler.

pliant loom
#

unfortunately it's inside a webview in the app

static warren
#

oh wait, then that's most likely the issue! a lot of payment methods don't work inside webviews.

#

you should either redirect users to their full browser, or use our native SDK for mobie apps.

pliant loom
#

ok I see

static warren
#

could you try the Express Checkout Element outside of a webview to see if it works?

pliant loom
#

we will proceed in this way then, we develope a redirect into a browser page

#

is this ok?

static warren
#

yes should work

pliant loom
#

thank you for your help!

#

have a nice day!

static warren
#

happy to help ๐Ÿ™‚