1.0.0 • Published 3 years ago

ng-direct-pay-ipg v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

DirectPay Ipg

Version 1.0.0

DirectPay Payment Gateway Plugin for Angular can payment using MasterCard, Visa, Amex, Frimi and LankaQr.

dp-ipg-ng

Installation

Install the npm package.

npm i ng-direct-pay-ipg

Import in NgModule:

import {DirectPayIpgModule} from 'ng-direct-pay-ipg';

@NgModule({
  imports: [
    //set with default global config
    DirectPayIpgModule.forRoot({size: 200,colour: 'gray'})
  ]
})

Usage

app.component.html

  * you can set multiple button with different configurations *
  <!-- override global configuration -->
  <direct-pay-ipg [config]="{  size: 150, type: 'round',colour: 'white'}" [PaymentRequest]="paymentRequest" (onSuccess)="onSuccess($event)" (onError)="onError($event)"></direct-pay-ipg>
  <!-- default button with global configuration -->
  <direct-pay-ipg [PaymentRequest]="paymentRequest" (onSuccess)="onSuccess($event)" (onError)="onError($event)"></direct-pay-ipg>

app.component.ts

paymentRequest = {
    signature: this.signature,
    dataString: this.dataString,
    stage: 'DEV'
};

public onSuccess(param: any): void {
  console.log('client-onSuccess',param);
  alert(JSON.stringify(param))
}

public onError(param: any): void {
  console.log('client-onError',param);
  alert(JSON.stringify(param))
}

Properties

NameTypeDefault valueAllow valuesDescription
sizenumber200anyButton size
typestringflatflat / roundButton border style
colourstringgrayblue / white / black / grayButton colour
PaymentRequestObject{signature: object, dataString: string, stage: string (allow only: 'DEV' or 'PROD')}Generated payment requested included payment details

Events

EventDescriptionReturnType
onSuccessThe event is called after transaction success or failedJSON
onErrorThe event is called when receive error transaction initiate or transactions processingJSON

Buttons

dp-ipg-ng-button

This library was generated with Angular CLI version 12.0.5.