Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rave-simple

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rave-simple

Framework/library agnostic flutterwave's rave web wrapper

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

rave-simple

rave-simple bundle size MIT NPM

<1kb Framework/Library agnostic rave wrapper

INSTALLATION

npm install rave-simple

USAGE

Basic Usage

import rave from "rave-simple";

const rave = Rave();

rave.addOptions({
  PBFPubKey: 'PBFPubKey-xxxx-xxxx',
  customer_email: 'mail@example.com',
  customer_phone: '0810987655432',
  amount: 150000,
  txref: `REF-${(Math.random() * 10000).toFixed()}`,
  callback: () => {
    r.close();
  },
});

rave.pay();

Test Environment

import rave from "rave-simple";

const rave = Rave({ test: true }); // Uses rave's test script

rave.addOptions({
  PBFPubKey: 'PBFPubKey-xxxx-xxxx',
  customer_email: 'mail@example.com',
  customer_phone: '0810987655432',
  amount: 150000,
  txref: `REF-${(Math.random() * 10000).toFixed()}`,
  callback: () => {
    r.close();
  },
});

rave.pay();

Set GlobalConfig

import Rave, { setGlobalConfig } from "rave-simple";

setGlobalConfig({ PBFPubKey: 'PBFPubKey-xxxx-xxxx' }) // Key has been set globally

const paymentInstance = Rave();

paymentInstance.addOptions({ // No need to add it here
  amount: 5000,
  customer_email: 'mail@example.com',
  customer_phone: '0810987655432',
  callback: (res) => {
    paymentInstance.close()
    // act on response
  }
})

paymentInstance.pay() // Pay

What's Cool?

  • Less than 1kb
  • Framework/Library agnostic
  • Simple API
  • Intellisense support

Keywords

FAQs

Package last updated on 31 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc