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

angular-ippopay

v1.0.2

Published

The Ippopay Payments plugin allows you to accept credit card, UPI, Netbanking and debit card payments via Ippopay payment gateway in your Angular JS.

Downloads

10

Readme

angular-ippopay

IppoPay Payment Gateway for your Online Business.

Install

with npm

npm install --save angular-ippopay

Usage

IppoPay Payment Gateway uses sensible defaults, so only minimal configuration via props is necessary.

Basic configuration

How to do configuration in your Angular Project?

Step 1

Add the below script in angular-cli.json or angular.json.

  "scripts": [
    "./node_modules/angular-ippopay/index.js"
  ]

Step 2

In your Typescript file. follow the instructions.

To initialize the IppoPay Payment.

//To Declare the Ippopay Payment

declare var Ippopay: any;

// For Success and Error Handlers. You can get the Payment status in the below function, it may be success or error. 

const ippopayHandler = ( function (e) {
  if(e.data.status == 'success'){
        console.log(e.data)
    }
    if(e.data.status == 'failure'){
        console.log(e.data)
    }
});
window.addEventListener('message', ippopayHandler);

//To Initialize the Ippopay Payment

constructor(){
    Ippopay.init();
}


To Open the Ippopay Payment Popup. Get the Order ID (ORDER_ID) from Step 3.


Ippopay.open('ORDER_ID','PUBLIC_KEY');

To Close the Ippopay Payment Popup


Ippopay.close();

Step 3

Create order from Server side using below API and get the Order id.

  POST API LINK :
  https://public_key:[email protected]/v1/order/create

  BODY:
  amount : YOUR_TRANSACTION_AMOUNT
  currency : YOUR_CURRENCY_CODE
  payment_modes : OPTIONAL /*  Available modes are cc,dc,nb,upi */
  customer : OPTIONAL /*note : auto render in payment popup*/

Example Request

  {
    "amount": YOUR_TRANSACTION_AMOUNT,
        "currency": YOUR_CURRENCY_CODE,
        "payment_modes": "cc,dc,nb,upi" ,
        "customer": {
          "name": Customer_Name,
          "email": Customer_Email,
          "phone": {
                "country_code": Phone_Country_Code ,
                "national_number": Phone_Number
            }
          }
  }

In response for the above request, you will get Order ID (order_id - params).

Step 4

When you click place order button our popup will be loaded so you can use below test card credentials to complete the order.

  Card Number 4111 1111 1111 1111
  Expiry 05/20
  CVV 123

  Card Number 4242 4242 4242 4242
  Expiry 05/23
  CVV 123

Success and Error Handlers

React IppoPay gives you the handlers for Payment status and details.

After Payment done, the below line sends the Payment details and status to ippopayHandler function.

window.addEventListener('message', this.ippopayHandler);

You can get the Payment status in the below function, it may be success or error.

  const ippopayHandler = ( function (e) {
  if(e.data.status == 'success'){
        console.log(e.data)
    }
    if(e.data.status == 'failure'){
        console.log(e.data)
    }
});

Sample Integration - App.component.ts

import { Component, OnInit } from '@angular/core';
import "@angular/compiler";
declare var Ippopay: any;
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  constructor() {
    console.log('Called Constructor');
    Ippopay.init();
  }
  ngOnInit() {
    console.log('Called ngOnInit method');
    const ippopayHandler = ( function (e) {
      if(e.data.status == 'success'){
            console.log(e.data)
        }
        if(e.data.status == 'failure'){
            console.log(e.data)
        }
    });
    window.addEventListener('message', ippopayHandler);
    Ippopay.open('ORDER_ID','PUBLIC_KEY');
  }  
}

Author

This component is written by IppoPay.

License

IppoPay 2020 © All Rights Reserved. IppoPay