Skip to content

Commit 26d10ef

Browse files
feat(clover-go): add support to pass signature and void payment (#3485)
Added support to pass signature incase the card payment require signature for authorisation Added support to void any payment Removed iOS platform for now as it will be supported in coming releases
1 parent d7ccd45 commit 26d10ef

File tree

1 file changed

+35
-1
lines changed
  • src/@ionic-native/plugins/clover-go

1 file changed

+35
-1
lines changed

src/@ionic-native/plugins/clover-go/index.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export interface SaleResponse extends Response {
2424
cardFirst6?: string;
2525
cardLast4?: string;
2626
}
27+
export interface VoidPaymentResponse extends Response {
28+
paymentId?: string;
29+
}
2730

2831
/**
2932
* @name Clover Go
@@ -56,6 +59,14 @@ export interface SaleResponse extends Response {
5659
* .then((res: any) => console.log(res))
5760
* .catch((error: any) => console.error(error));
5861
*
62+
* this.cloverGo.sign(signInfo)
63+
* .then((res: any) => console.log(res))
64+
* .catch((error: any) => console.error(error));
65+
*
66+
* this.cloverGo.voidPayment(paymentInfo)
67+
* .then((res: any) => console.log(res))
68+
* .catch((error: any) => console.error(error));
69+
*
5970
* ```
6071
*/
6172
@Plugin({
@@ -64,7 +75,7 @@ export interface SaleResponse extends Response {
6475
pluginRef: 'clovergo',
6576
repo: 'https://github.com/hotwax/cordova-plugin-clovergo',
6677
install: 'ionic plugin add cordova-plugin-clovergo',
67-
platforms: ['Android', 'iOS'],
78+
platforms: ['Android'],
6879
})
6980
@Injectable()
7081
export class CloverGo extends IonicNativePlugin {
@@ -107,4 +118,27 @@ export class CloverGo extends IonicNativePlugin {
107118
sale(saleInfo: object): Promise<SaleResponse> {
108119
return;
109120
}
121+
122+
/**
123+
* This method is used to pass signature as two
124+
* dimensional number array that represents points
125+
* of signature on screen.
126+
* The list is passed as signature in SignInfo object.
127+
* @param signInfo {object}
128+
* @return {Promise<SaleResponse>}
129+
*/
130+
@Cordova()
131+
sign(signInfo: object): Promise<SaleResponse> {
132+
return;
133+
}
134+
135+
/**
136+
* This function void any payment done through the device
137+
* @param saleInfo {object}
138+
* @return {Promise<VoidPaymentResponse>}
139+
*/
140+
@Cordova()
141+
voidPayment(paymentInfo: object): Promise<VoidPaymentResponse> {
142+
return;
143+
}
110144
}

0 commit comments

Comments
 (0)