equal-idg-angular
Version:
Equal Idg Plugin
68 lines (48 loc) • 1.55 kB
Markdown
# Equal IDG Sdk
install the latest version using npm i equal-idg-angular@x.x.x
* 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.
```jsx
onOpenGateway(response: any) {
console.log('Gateway opened', response);
}
onClosureGateway(response: any) {
console.log('Gateway closed', response);
}
```
Sample snippet to invoke Equal SDK.
```jsx
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { EqualSdkService } from 'equal-idg-angular';
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);
}
}
```