feat(sumup): add test and setup function (#3950)

* feat(sumup): add setup and test function

* feat(sumup): add title as parameter in pay function
This commit is contained in:
Marius Backes 2022-01-03 15:47:15 +01:00 committed by GitHub
parent f5c5e7d179
commit 7350c630fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<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;
}
}