#karthikeyan_api

1 messages ¡ Page 1 of 1 (latest)

safe notchBOT
#

👋 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/1347170137039704065

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

elfin harbor
#

hi there!

#

what's your question?

snow torrent
#

I will share the error screenshot. Just give me a minute

#

We are faced the above error

elfin harbor
#

can you share more context on what you ar trying to do?

snow torrent
#

Once we submit the googlepay payment we encounter the above issue

#

Here is the Code:

        const handleError = (error) => {
        const messageContainer = document.querySelector('#error-message');
          messageContainer.textContent = error.message;
        }
        // Send paymentMethod to server.
        expressCheckoutElement.on('confirm', async (event) => {
          const {error: submitError} = await elements.submit();
          if (submitError) {
            handleError(submitError);
            return;
          }

          // Create the PaymentIntent and obtain clientSecret
          const res = await fetch('/create-intent', {
            method: 'POST',
          });
          const {client_secret: clientSecret} = await res.json();

          // call Stripe function to initiate payment confirmation
          const {error} = await stripe.confirmPayment({
            // `elements` instance used to create the Express Checkout Element
            elements,
            // `clientSecret` from the created PaymentIntent
            clientSecret,
            confirmParams: {
              return_url: 'https://www-stp.hawkusa.com/checkout//complete',
            },
          });
          if (error) {
            conole.error(error);
            // This point is only reached if there's an immediate error when
            // confirming the payment. Show the error to your customer (for example, payment details incomplete)
            handleError(error);
          } else {
            // The payment UI automatically closes with a success animation.
            // Your customer is redirected to your `return_url`.
          }
        });
elfin harbor
#

which line of code exactly is triggering that error?

snow torrent
#

const {client_secret: clientSecret} = await res.json();

elfin harbor
#

then the issue is on your /create-intent code on the server.

#

did you check your server logs?

snow torrent
#

Okay will check and let you know