Skip to content

Commit

Permalink
feat(sumup): add test and setup function (#3950)
Browse files Browse the repository at this point in the history
* feat(sumup): add setup and test function

* feat(sumup): add title as parameter in pay function
  • Loading branch information
mariusbackes authored Jan 3, 2022
1 parent f5c5e7d commit 7350c63
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions src/@awesome-cordova-plugins/plugins/sum-up/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
*
Expand Down Expand Up @@ -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<SumUpResponse>} Return a SumUpResponse object
*/
@Cordova()
setup(): Promise<SumUpResponse> {
return;
}

/**
* Test the SumUp integration using SDK tests.
*
* @returns {Promise<SumUpResponse>} Return a SumUpResponse object
*/
@Cordova()
test(): Promise<SumUpResponse> {
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<SumUpResponse>} Return a SumUpResponse object
*/
@Cordova()
pay(amount: number, currencycode: string): Promise<SumUpPayment> {
pay(amount: number, title?: string, currencyCode?: string): Promise<SumUpPayment> {
return;
}
}

0 comments on commit 7350c63

Please sign in to comment.