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