From 7350c630fea4db8c31a07f46b4464bab2f1b55e4 Mon Sep 17 00:00:00 2001 From: Marius Backes Date: Mon, 3 Jan 2022 15:47:15 +0100 Subject: [PATCH] feat(sumup): add test and setup function (#3950) * feat(sumup): add setup and test function * feat(sumup): add title as parameter in pay function --- .../plugins/sum-up/index.ts | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/@awesome-cordova-plugins/plugins/sum-up/index.ts b/src/@awesome-cordova-plugins/plugins/sum-up/index.ts index 60974b1f9..3434b978e 100644 --- a/src/@awesome-cordova-plugins/plugins/sum-up/index.ts +++ b/src/@awesome-cordova-plugins/plugins/sum-up/index.ts @@ -111,7 +111,7 @@ export class SumUpKeys { * .then((res: SumUpResponse) => console.log(res)) * .catch((error: SumUpResponse) => console.error(error)); * - * this.sumUp.pay(10.0, 'EUR') + * this.sumUp.pay(10.0, 'Transaction title', 'EUR') * .then((res: SumUpPayment) => console.log(res)) * .catch((error: SumUpPayment) => console.error(error)); * @@ -203,16 +203,38 @@ export class SumUp extends AwesomeCordovaNativePlugin { return; } + /** + * Will setup the SumUP SDK. + * This action is required before using other functions. + * + * @returns {Promise} Return a SumUpResponse object + */ + @Cordova() + setup(): Promise { + return; + } + + /** + * Test the SumUp integration using SDK tests. + * + * @returns {Promise} Return a SumUpResponse object + */ + @Cordova() + test(): Promise { + return; + } + /** * Opens a native SumUp window to proceed a payment. Parameter amount and currencycode are required. * If the Payment was successful it returns an SumUpPayment object with information about the payment. * * @param amount {number} - * @param currencycode {string} + * @param title {string} + * @param currencyCode {string} * @returns {Promise} Return a SumUpResponse object */ @Cordova() - pay(amount: number, currencycode: string): Promise { + pay(amount: number, title?: string, currencyCode?: string): Promise { return; } }