🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-ravepayment

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ravepayment

This is a reactJS library for implementing rave payment gateway

3.0.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

react-ravepayment

A React library wrapper for implementing ReavePay Payment Gateway

Demo

Alt text

Installation

npm install react-ravepayment --save

or

yarn add react-ravepayment --save

Usage

Hooks

import React, { Component } from "react";
import { useRavePayment } from "react-ravepayment";

const config = {
  txref: "rave-123456",
  customer_email: "user@example.com",
  customer_phone: "234099940409",
  amount: 2000,
  PBFPubKey: "FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXX-X",
  production: false,
};

const App = () => {
  const { initializePayment } = useRavePayment(config);
  return (
    <div>
      <button onClick={() => initializePayment()}>Pay 2000</button>
    </div>
  );
};

export default App;

Components

import React, { Component } from "react";
import { RaveProvider, RavePaymentButton } from "react-ravepayment";

const config = {
  txref: "rave-123456",
  customer_email: "user@example.com",
  customer_phone: "234099940409",
  amount: 2000,
  PBFPubKey: "FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXX-X",
  production: false,
  onSuccess: () => {},
  onClose: () => {}
};

const App = () => {
  return (
    <div>
      <RaveProvider {...config}>
        <RavePaymentButton>Pay 2000</RavePaymentButton>
      </RaveProvider>
    </div>
  );
};

export default App;

For more usage example check

API

See the API reference.

Deployment

WHEN DEPLOYING TO PRODUCTION/LIVE SYSTEM, take note of the following;

  • Change isProduction attribute in the component tag to true i.e isProduction={true}
  • Change RavePay PUBLIC KEY
  • Ensure you implement webhooks to receive automatic updates when a transaction happens.

Contribution

  • Fork it!
  • Create your feature branch: git checkout -b feature-name
  • Commit your changes: git commit -am 'Some commit message'
  • Push to the branch: git push origin feature-name
  • Submit a pull request 😉😉

This project follows the all-contributors specification. Contributions of any kind welcome!

Issues

Looking to contribute? Look for the Good First Issue label.

🐛 Bugs

Please file an issue for bugs, missing documentation, or unexpected behavior.

License

MIT

Keywords

Javascript

FAQs

Package last updated on 26 Mar 2020

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