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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ionic-ravey

v1.0.1

Published

An ionic module to help you integrate rave inline payment modal

Downloads

1

Readme

Ionic 3 Rave

An Ionic 3 module to add Rave Pay Button into your ionic apps.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Ensure that you have signed up for a Rave account. If not, go here to signup for a live account or here to signup for a test account.

Ensure that you have nodejs and npm installed. If download Nodejs from here and install it.

Installing nodejs also install npm with it.

Once you have nodejs and npm installed, proceed install cordova using the command below

npm install -g ionic

NOTE: if you are a MAC or Linux user, you might need to append sudo before npm install -g ionic i.e

sudo npm install -g ionic

Installing

In your project folder, run

npm install --save ionic-rave

Features

  1. ionic-rave exports a component <rave-component> </rave-component> that you can add to your html page. <rave-component> simply creates a button with whatever text you pass into pay_text.

Sample rave-component call

<rave-component (click)="pay()" pay_text="Pay Now"></rave-component>

  1. ionic-rave exports a function setup which you must call in order to initiate loading the Rave payment modal. setup takes two arguments:

    • production: a boolean value that determines whether you want the live or sandbox environment (for testing)

    • payload: an object containing all the necessary properties to spin up the payment modal. The properties are explained below:

      PBFPubKey: This is your Rave public key and can be gotten from your rave dashboard - Required

      amount: The amount you want to charge your customers. If omitted, A customer will be able to specify the amount - Required

      customer_email: this is the merchant's email address - Required

      customer_phone: phone number of the customer - Required

      currency: The currency you want to charge your customers in. If omitted, it defaults to NGN

      country: The merchant's country. Defaults to Nigeria

      custom_title: A title for your payment

      custom_description: Text describing what your customers are paying for

      redirect_url: This is the url that rave sends the response of your transaction to. It should be configured to handle a get request. If not supplied, no response will be sent from Rave

      payment_plan_id: If you want to bill your customers recurrently, pass in the payment plan id here. It must be an integer

      payment_options: This allows you select the payment option you want for your users.

      subaccounts: This is an array of objects containing the subaccount IDs to split the payment into.

      custom_logo: Link to the Logo image.

      txref: Unique transaction reference provided - Required

    Go here for more options

The setup returns an object with properties valid, payload (if the payment details passed are valid), error (if any of the payment details passed is not valid ).

A sample call is shown below:

this.test.setup(true, {
      PBFPubKey: "FLWPUBK-8bf84c62ed00abccc4ce37e12638ad63-X",
      customer_email: "[email protected]",
      amount: 1,
      customer_phone: "08074376980",
      currency: "NGN",
      payment_options: "card,account,ussd,mpesa",
      txref: "Mx-990000TD",
      redirect_url: "https://agile-journey-11424.herokuapp.com"
    });
}

Sample setup error response

{valid: false, error: [{'property': PBFPubkey, 'error': 'PBFPubKey is a required field and cannot be empty'}]}
  1. Once you call the setup function, the getpaidSetup function will be available globally for you to call to show the payment modal.

Sample

pay() {
    if(this.info["valid"] == true) getpaidSetup(this.info["payload"])
    else console.log(this.info["error"])
}

Deployment

Here are a few things to note

  1. If you set production to false then ensure that you're using your rave sandbox api keys i.e public and secret key
  2. If you set production to true then ensure that you're using your rave live api keys i.e public and secret key

Support :

  • For any bugs about this module, please feel free to report here.
  • And you are welcome to fork and submit pull requests.

License

This project is licensed under the MIT License