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

256
Visualizações
How to create checkout session for payment intent?

I'm using stripe to create an payment integration in my system, after creating an payment intent i want to create checkout session for this payment, after this i want to retrieve an url property from this checkout and send to the user.

But i don't have an idea how to "connect" created payment intent to checkout session.

Right now i create payment intent in this way:

    const paymentIntent = await stripe.paymentIntents.create(
      {
        amount: 500,
        currency: "usd",
        customer: customerId
      },
      {
        stripeAccount: ""
      }
    );

and checkout session:

    const session = await stripe.checkout.sessions.create({
      success_url: "",
      cancel_url: "",
      mode: "payment",
      customer: customerId,
      payment_method_types: ["card"]
    });

The problem is in this, that i don't know how to create checkout session based on created before an payment intent.

Thanks for any help!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The Checkout Session itself will create a PaymentIntent. You can create an equivalent PaymentIntent with the line_items.price_data.unit_amount[1], line_items.price_data.currency[2], and customer[3] parameters of the checkout.sessions.create call. Make sure to pass in the stripeAccount parameter to your Session creation call as well if you want to create the Session/PaymentIntent on their account.

[1] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-unit_amount

[2] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-currency

[3] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer

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