equal-idg-angular
v1.0.3
Published
Equal Idg Plugin
Downloads
31
Readme
Equal IDG Sdk
install the latest version using npm i [email protected]
client_id : Client Id shared by Equal during onboarding
idempotency_id : (Mandatory) Idempotency Id created by your system during the init api as part of Step 1
token : (Mandatory) Token generated and shared in response from Step 1
onOpenGateway and onClosureGateway will help to know the gateway status.
onOpenGateway(response: any) {
console.log('Gateway opened', response);
}
onClosureGateway(response: any) {
console.log('Gateway closed', response);
}
Sample snippet to invoke Equal SDK.
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { EqualSdkService } from 'equal-idg-angular';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {
constructor(private equalSdkService: EqualSdkService) {}
onButtonTap(){
this.equalSdkService.loadScript().then(() => {
this.equalSdkService.initSDK(
"<clinet-id>",
"<token>",
"<idempotency_id>",
this.onOpenGateway.bind(this),
this.onClosureGateway.bind(this),
{}
);
}).catch(error => console.error('Failed to load Equal SDK script', error));
}
onOpenGateway(response: any) {
console.log('Gateway opened', response);
}
onClosureGateway(response: any) {
console.log('Gateway closed', response);
}
}