react-native-stripe-client

0.0.3 • Public • Published

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 🔗

const response = await stripeClient.createToken({
  card: {
    number: "4242424242424242",
    exp_month: 12,
    exp_year: 2020,
    cvc: "123"
  }
});

Creating a bank account token 🔗

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 🔗

var information = {
  pii: {
    personal_id_number: "000000000"
  }
};
const pii = await stripeClient.createToken(information);

Create a PaymentMethod 🔗

const response = await stripeClient.createPaymentMethod("card", {
  number: "4242424242424242",
  exp_month: 12,
  exp_year: 2020,
  cvc: "123"
});

Create a SetupIntent 🔗

const intentResponse = await stripe.handleCardSetup(
  setupIntentId,
  id, //PaymentMethod id
  clientSecret
);

Package Sidebar

Install

npm i react-native-stripe-client

Weekly Downloads

5

Version

0.0.3

License

MIT

Unpacked Size

4.89 kB

Total Files

4

Last publish

Collaborators

  • kaizer433