Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

310
Visualizações
How can I retrieve the result value from stripe.redirectToCheckout()?

I am trying to get the result value from a stripe.redirectToCheckout(). It is said to return a Promise https://stripe.com/docs/js/checkout/redirect_to_checkout. Here is the code that I thought would work but it doesn't

    stripe.redirectToCheckout({
      lineItems: [
        {
          price: stripePrice,
          quantity: token,
        },
      ],
      mode: "payment",
      successUrl: someurl
      cancelUrl: someurl
    }).then(result => {
        if (result.error) {
            alert(result.error.message);
        }
    })
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Both client-only Checkout and redirectToCheckout are no longer recommended.

Instead you can use Payment Links (if you need a client-only solution) or you can create Checkout Sessions on your server and send people to the url on the Checkout Session object.

Regarding your original question, though, redirectToCheckout will only return a promise if the redirect fails. If the redirect succeeds the JavaScript running on your page will stop running because the browser will have navigated to another page (the Stripe Checkout page), so there's no chance for anything to be returned.

about 4 years ago · Juan Pablo Isaza Relatório

0

You can't get data out of this function as you are redirected and your script ceases to exist

Stripe wile redirect you back after user checkout and then you have to read the data.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda