Skip to content

dskoneczny/react-native-stripe-api

 
 

Repository files navigation

react-native-stripe-api

Downloads Circle CI

The best Stripe library for React Native.

Installation

$ npm i react-native-stripe-api --save

Setup

Stripe API

This lib need a Stripe API Key

const apiKey = '<your Stripe API Key>';
const Stripe = new Stripe(apiKey);

Functions

Name Return Type Arguments Description
createToken Promise
  • cardNumber: string
  • expMonth: string
  • expYear: string
  • cvc: string
Create a new token (equivalent of a new card)
createCustomer Promise
  • token: string
  • email: string
Create a new customer and add card (or token)
getCustomer Promise customerId: string Retrieve customer by its id
createCharge Promise
  • amount: number
  • customer: string
  • description: string
  • currency: string = 'eur'
Create a new charge
refundCharge Promise chargeId: string Refund a previous charge
addCardToCustomer Promise
  • token: string
  • customerId: string
    Add a new card to a customer
    destroyCardOfCustomer Promise
    • cardId: string
    • customerId: string
    Delete a card from a customer

    Contribution

    Questions

    Feel free to contact me or create an issue

    made with ♥

    About

    A small React Native library for Stripe Rest API

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages

    • JavaScript 100.0%