Skip to content

kaissaroj/react-native-stripe-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Example

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
);

Releases

No releases published

Packages

No packages published