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

158
Visualizações
create payment with the token of a saved card and 3d secure

I have integrated Stripe for payments. I managed to save a card by obtaining the token, created the customer, and associated the token with the customer. Now I am trying to make a backend (node) side payments using this code:

    const createCharge = await stripe.charges.create({
        amount,
        currency: 'eur',
        customer: user.stripeCustomerId,
        card: cardId,
        description: `userId: ${user._id}`,
      });

If the card does not require authentication it works perfectly while if authentication is required it obviously fails with the error: authentication_required. I tried to add authentication with 3d secure in-app but without success, this is what I tried but I always get errors and no authentication is done

    const { paymentIntent, error } = await confirmPayment(clientSecret.client_secret, {
            payment_method_options:{
                "card": {
                    "installments": null,
                    "network": null,
                    "request_three_d_secure": "any"
                }
            },
            type: 'Card',
            cardDetails: this.props.cardList[0].cardId,
            payment_method:'creditCard',
            setupFutureUsage: 'OffSession',
        });

Does anyone have any idea what I'm doing wrong? Thanks!

about 4 years ago · Juan Pablo Isaza
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