JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 122
  • Score
    100M100P100Q57534F
  • License MIT

Raven Atlas NodeJS Payment SDK

Package Exports

  • atlas-pay-sdk
  • atlas-pay-sdk/bundles/index.umd.js
  • atlas-pay-sdk/esm5/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (atlas-pay-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Atlas Pay by Raven

NPM version Build npm-typescriptLicense[github-license-url]

Atlas Pay by Raven bank allows you recieve payments and build powerful checkout experience on your website and apps, to use this you will need to create an account on raven atlas, visit, "Raven bank" for more.

Live Demo

✨ Features

  • Card Payments. (Visa, MasterCard)
  • USSD Payment.
  • Bank Transfers.
  • NQR Payments.
  • Pay with Raven.

Installation:

npm install atlas-pay-sdk

or

```bash
yarn add atlas-pay-sdk

Usage :

Atlas-Pay provides you with few Javascript API's to interact with below is an example implementation of the atlas-pay library:



import './App.css'
import  {AtlasPay}  from 'atlas-pay-sdk';

function App() {
  AtlasPay.onSuccess = function(data) {
    /**
     * handle successful payment
     * (optional) : you can decide to retrieve the onSuccess message we send via data, the message contains the payload of the successful payment.
    **/
    console.log('Payment successful:', data);
  }

  AtlasPay.onClose = function(data) {
       /**
     * handle close event, this happens when user closes the payment modal
     * (optional) : you can decide to retrieve the onClose message we send via data
     * (optional) : if you want to force close the payment window on onClose you can call the shutdown API within the onClose
     * (note) : this also triggers when the close modal button is clicked after successful paymen, but the message returned is 'payment_successful' , you can hook into this and do your magic.
    **/

    console.log('Payment modal Closed:', data);

    // optional shutdown
    AtlasPay.shutdown()
  }

  AtlasPay.shutdown() /* This closes the payment window and removes it from your DOM */

  AtlasPay.onResponse = function(data) {
       /**
     * handle generate response, this triggers when you try generating a new ref via AtlasPay.generate(), you catch ther response here
     * (required) : you are to retrieve the response via the data returned
    **/
      console.log('We got a response:', data); // or do your stuff here
  }


  AtlasPay.onLoad = function(data) {
    /**
  * this triggers when the payment window is loaded onto your dom, it returns for you a payload containing the payment object.
  * (optional) : you can decide to retrieve the payment object we send via data
 **/
   console.log('Payment window loaded:', data); // or do your stuff here
}

  // set up your new payment parameters, along side your secret key

  let config = {
    "customer_email": "john@example.com",
    "description" : "test payment",
    "merchant_ref": "your_merchant_reference",
    "amount": 100,
    "redirect_url": "",
    "payment_methods" : "card,bank_transfer,ussd,raven",
    "secret_key" : "your_atlas_secret_key"
}


  return (
    <>
    {/* This button will fire the generate function */}
    <button onClick={()=> AtlasPay.generate(config)}>Generate New Ref</button>

    {/* This button will fire the init function and load up the payment window */}
     <button onClick={()=> AtlasPay.init('202304211026JBCAADE')}>Initialize Payment Window</button>
    </>
  )
}

export default App