Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda