react-native-stripe-client
v0.0.3
Published
Stripe Client For React/React Native
Downloads
6
Readme
React/React Native Stripe Client
React/React Native Stripe wrapper for using Stripe in Web/iOS/Android.
Installation
npm install react-native-stripe-client --save
Usage
import stripe from 'react-native-stripe-client'
const stripeClient = stripe("YOUR_PUBLISHABLE_STRIPE_API_KEY");
Creating a token :link:
const response = await stripeClient.createToken({
card: {
number: "4242424242424242",
exp_month: 12,
exp_year: 2020,
cvc: "123"
}
});
Creating a bank account token :link:
const information = {
bank_account: {
country: "US",
currency: "usd",
account_holder_name: "saroj s",
account_holder_type: "individual",
routing_number: "110000000",
account_number: "000123456789"
}
};
const bank = await stripeClient.createToken(information);
Creating a PII token :link:
var information = {
pii: {
personal_id_number: "000000000"
}
};
const pii = await stripeClient.createToken(information);
Create a PaymentMethod :link:
const response = await stripeClient.createPaymentMethod("card", {
number: "4242424242424242",
exp_month: 12,
exp_year: 2020,
cvc: "123"
});
Create a SetupIntent :link:
const intentResponse = await stripe.handleCardSetup(
setupIntentId,
id, //PaymentMethod id
clientSecret
);