npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-rave-networking

v1.0.4

Published

Library for making Rave API calls on react-native

Readme

Rave API calls for React-Native

Sample Account Transaction

import RaveApi from 'react-native-rave-networking';

rave = new RaveApi("ENTER_YOUR_PUBLIC_KEY", "ENTER_YOUR_PRIVATE_KEY", production= true|false);

async accountCharge() {
  // remember to pass passcode for zenith bank
  try {
    let payload = {
      "accountbank": "232", // get the bank code from the bank list endpoint.
      "accountnumber": "0061333471",
      "currency": "NGN",
      "country": "NG",
      "amount": "100",
      "email": "[email protected]",
      "phonenumber": "0902620185",
    }

    let res = await this.rave.Account.charge(payload)
      
    if (res.authUrl) {
      this.setState({
        "displayModal": true,
        "url": res.authUrl
      });
    } 
        // if it is not
    else {
      res = await this.rave.Account.validate("12345", res.flwRef)
      res = await this.rave.Account.verify(res.txRef)
      console.log(res)
    }  
  }
  catch (e) {
    console.error(e);
  }
  
}

Sample Card Transaction

import RaveApi from 'react-native-rave-networking';

async cardCharge() {
  try {
    payload = {
      "cardno": "4556052704172643",
      "cvv": "812",
      "expirymonth": "01",
      "expiryyear": "19",
      "currency": "NGN",
      "country": "NG",
      "amount": "100",
      "email": "[email protected]",
      "phonenumber": "08056552980",
      "firstname": "user",
      "lastname": "example",
      "billingzip": "07205",
      "billingcity": "Hillside",
      "billingaddress": "470 Mundet PI",
      "billingstate": "NJ",
      "billingcountry": "US",
      "IP": "40.198.14"
    }

    res = await this.rave.Card.charge(payload)

    if (res.suggestedAuth) { 
      // update payload and recall charge
    }
    

    if (!res.validationCompleted) {

      // if an auth url is required for validation
      if (res.authUrl) { 

        // display the vbv modal, could set state that displays it and pass the url
        this.setState({
          "displayModal": true,
          "url": res.authUrl
        });
      } 

      // if an auth url isn't required
      else {
        // pass the otp to the validate call
        res = await this.rave.Card.validate("12345", res.flwRef);
        res = await this.rave.Card.verify(res.txRef)
        console.log(res)
      }

    }

  } 
  catch(e) {
    console.error(e);
  }

Sample Card Preauth Transaction

import RaveApi from 'react-native-rave-networking';

rave = new RaveApi("ENTER_YOUR_PUBLIC_KEY", "ENTER_YOUR_PRIVATE_KEY", production= true|false);
rave.Card.preauth({
    "cardno": "5438898014560229",
    "cvv": "890",
    "expirymonth": "09",
    "expiryyear": "19",
    "amount": "10",
    "email": "[email protected]",
    "phonenumber": "0902620185",
    "firstname": "temi",
    "lastname": "desola",
    "IP": "355426087298442"
    })
      .then((res)=>{
        console.log(res);
      })
      .catch((err)=>{
        console.error(err);
      })

React Flows

Sample VBV Flow

import React from 'react';

import {
  StyleSheet,
  Text,
  View
} from 'react-native';

import RaveApi, {
  WebComponent
} from './RaveNetworking/RaveApi';


export default class App extends React.Component {
    constructor(props) {
        super(props);
        this.rave = new RaveApi("ENTER_YOUR_PUBLIC_KEY", "ENTER_YOUR_SECRET_KEY");
        this.state = {
        "displayModal": false,
        "url": null
        };
        this.cardCharge = this.cardCharge.bind(this);
        this.accountCharge = this.accountCharge.bind(this);
    }

    async cardCharge() {
        try {
            payload = {
                "cardno": "4556052704172643",
                "cvv": "812",
                "expirymonth": "01",
                "expiryyear": "19",
                "currency": "NGN",
                "country": "NG",
                "amount": "100",
                "email": "[email protected]",
                "phonenumber": "08056552980",
                "firstname": "user",
                "lastname": "example",
                "billingzip": "07205",
                "billingcity": "Hillside",
                "billingaddress": "470 Mundet PI",
                "billingstate": "NJ",
                "billingcountry": "US",
                "IP": "40.198.14"
            }

            res = await this.rave.Card.charge(payload)
            console.log(res);
            if (res.suggestedAuth) {
                // update payload and recall charge
            }


            if (!res.validationCompleted) {
                // if an auth url is required for validation
                if (res.authUrl) {
                    // display the vbv modal
                    this.setState({
                        "displayModal": true,
                        "url": res.authUrl
                    });
                } else {
                    // pass the otp to the validate call
                    res = await this.rave.Card.validate("12345", res.flwRef)
                    res = await this.rave.Card.verify(res.txRef);
                    console.log(res)
                }
            }

        } catch (e) {
            console.error(e);
        }
  }

  componentDidMount() {
    this.cardCharge();
  }

  
  render() {

    if(this.state.displayModal){
      return(
        <WebComponent url={this.state.url} getMessageReturned={async (err, message)=>{
          if (err) {
            console.error(message);
          } else {
                try {
                    // Check to see if the charge was successful
                    res = await this.rave.Card.verify(res.txRef);
                    console.log(res);
                    this.setState({ ...this.state,
                        displayModal: false
                    });

                } catch (e) {
                    // if it wasnt
                    console.error(e)
                }
          }
        }}/>
      );
    }

    return (
      <View style={{"marginTop":20}}>
        <Text>Waiting</Text>
      </View>
    );
  }
}