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

198
Visualizações
Error being thrown when dealing with Stripe using @stripe/stripe-react-native

I've added Stripe into my React-Native/Expo (SDK 42) App. I am trying to make it so follow the "create payment" method laid out on stripes website, but it keeps throwing the following error:

undefined Unable to resolve module stripe from ../../../../.js stripe could not be found within the project.

I've tried calling Stripe, but I still keep getting the error.

Below is the code where the error lives:

import { CardField, useStripe, StripeProvider, Stripe } from '@stripe/stripe-react-native'

const stripe = require('stripe')('testKey')

const paymentMethod = async() => {
await stripe.paymentMethods.create({
    type: 'card',
    card:{
        number: '4242424242424242',
        exp_month: 9,
        exp_year: 2022,
        cvc: '314'
    }
})

}

I adapted this from the Node.js version found here

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

0

The code that you've included in your question is meant to be called server-side with Stripe's Node client library. It cannot be adapted to work client-side with the Stripe's React Native SDK.

Instead, you want to be calling the React Native equivalent of stripe.createPaymentMethod() (see JS library ref). There's a quick example in the React Native library docs about how to do this here (it was originally written for folks migrating from the Tipsi library, but it should also work for your use case).

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