From 26d10ef63346782e6d8ed37ca89bd2dd7402aa0a Mon Sep 17 00:00:00 2001 From: Aditya Sharma Date: Fri, 14 Aug 2020 21:04:04 +0530 Subject: [PATCH] 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 --- src/@ionic-native/plugins/clover-go/index.ts | 36 +++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/clover-go/index.ts b/src/@ionic-native/plugins/clover-go/index.ts index c243d8bb3..98c26eebe 100644 --- a/src/@ionic-native/plugins/clover-go/index.ts +++ b/src/@ionic-native/plugins/clover-go/index.ts @@ -24,6 +24,9 @@ export interface SaleResponse extends Response { cardFirst6?: string; cardLast4?: string; } +export interface VoidPaymentResponse extends Response { + paymentId?: string; +} /** * @name Clover Go @@ -56,6 +59,14 @@ export interface SaleResponse extends Response { * .then((res: any) => console.log(res)) * .catch((error: any) => console.error(error)); * + * this.cloverGo.sign(signInfo) + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * this.cloverGo.voidPayment(paymentInfo) + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * * ``` */ @Plugin({ @@ -64,7 +75,7 @@ export interface SaleResponse extends Response { pluginRef: 'clovergo', repo: 'https://github.com/hotwax/cordova-plugin-clovergo', install: 'ionic plugin add cordova-plugin-clovergo', - platforms: ['Android', 'iOS'], + platforms: ['Android'], }) @Injectable() export class CloverGo extends IonicNativePlugin { @@ -107,4 +118,27 @@ export class CloverGo extends IonicNativePlugin { sale(saleInfo: object): Promise { return; } + + /** + * This method is used to pass signature as two + * dimensional number array that represents points + * of signature on screen. + * The list is passed as signature in SignInfo object. + * @param signInfo {object} + * @return {Promise} + */ + @Cordova() + sign(signInfo: object): Promise { + return; + } + + /** + * This function void any payment done through the device + * @param saleInfo {object} + * @return {Promise} + */ + @Cordova() + voidPayment(paymentInfo: object): Promise { + return; + } }