Giter Site home page Giter Site logo

rave-react-native's Introduction

Rave By Flutterwave React Native Component

Implement Rave By Flutterwave easily with React Native

Installation

Yarn or Node

You can pull in react-native-rave via npm:

npm install react-native-rave --save

OR

yarn add react-native-rave

Usage

  1. import Rave Component
import Rave from 'react-native-rave';
  1. Set your success and failure methods
 constructor(props) {
    super(props);
    this.onSuccess = this.onSuccess.bind(this);
    this.onFailure = this.onFailure.bind(this);
  }

  onSuccess(data) {
    console.log("success", data);

  }

  onFailure(data) {
    console.log("error", data);
  }
  1. Use component with the props
render() {
  return (
    <Rave 
        amount="500" 
        country="NG" 
        currency="NGN" 
        email="[email protected]" 
        firstname="Oluwole" 
        lastname="Adebiyi" 
        publickey="FLWPUBK-**************************-X" 
        secretkey="FLWSECK-**************************-X"
        paymenttype="both"
        meta={[{ metaname: "color", metavalue: "red" }, { metaname: "storelocation", metavalue: "ikeja" }]}
        production={false} 
        onSuccess={res => this.onSuccess(res)} 
        onFailure={e => this.onFailure(e)}
        />
  );
}
props parameter type required
publickey This is the publickey gotten from your Live or Test dashboard String Required
secretkey This is the secretkey gotten from your Live or [Test]
amount This is the amount to be charged from card/account String Required
email This is the email of the customer String Required
phone This is the phone number of the customer String Not Required
firstname This is the firstname of the customer String Required
lastname This is the lastname of the customer String Required
onSuccess This is the function that receives data for a successful transaction Function Required
onFailure This is the function that receives data for a failed transaction Function Required
country This is the country you are transacting from eg. NG, GH, KE, ZA String Not Required (defaults to NG)
currency This is the currency you want to charge the customer eg. NGN, GHS, KES, ZAR String Not Required (defaults to NGN)
txref This is a unique reference for the transaction String Not Required (will be generated automatically)
primarycolor This is to override the primary colour of the component String Not Required
secondarycolor This is to override the secondary colour of the component String Not Required
paymenttype This is the payment type ['both','card', 'account'] String Not Required ('defaults to both')
production Set to true if you want your transactions to run in the production environment otherwise set to false. Defaults to false Boolean Not Required ('defaults to false')
meta This is additional information that can be sent to the server eg [{ metaname: "color", metavalue: "red" }, { metaname: "storelocation", metavalue: "ikeja" }] Array of Objects Not Required

rave-react-native's People

Contributors

mopilo avatar temiadesina avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.