diff --git a/src/@ionic-native/plugins/sum-up/index.ts b/src/@ionic-native/plugins/sum-up/index.ts index 7e3e5954a7..c87e5f2e29 100644 --- a/src/@ionic-native/plugins/sum-up/index.ts +++ b/src/@ionic-native/plugins/sum-up/index.ts @@ -52,6 +52,23 @@ export interface SumUpPayment { installments: number; } +/** + * @hidden + */ +export class SumUpKeys { + + // The generated accessToken, to automate the login process + accessToken: string; + + // affiliateKey can also be set in the object, if it has to be changed on runtime + affiliateKey: string; + + constructor() { + this.accessToken = ''; + this.affiliateKey = ''; + } +} + /** * @name SumUp * @description @@ -64,11 +81,15 @@ export interface SumUpPayment { * * constructor(private sumUp: SumUp) { } * - * this.sumUp.login("ACCESS_TOKEN") + * const sumUpKeys: SumUpKeys = new SumUpKeys(); + * sumUpKeys.affiliateKey = 'YOUR_API_KEY'; // if not provided in installation + * sumUpKeys.accessToken = 'YOUR_ACCESS_TOKEN'; + * + * this.sumUp.login(sumUpKeys) * .then((res: SumUpResponse) => console.log(res)) * .catch((error: SumUpResponse) => console.error(error)); * - * this.sumUp.auth("ACCESS_TOKEN") + * this.sumUp.auth('YOUR_ACCESS_TOKEN') * .then((res: SumUpResponse) => console.log(res)) * .catch((error: SumUpResponse) => console.error(error)); * @@ -92,7 +113,7 @@ export interface SumUpPayment { * .then((res: SumUpResponse) => console.log(res)) * .catch((error: SumUpResponse) => console.error(error)); * - * this.sumUp.pay(10.0, "EUR") + * this.sumUp.pay(10.0, 'EUR') * .then((res: SumUpPayment) => console.log(res)) * .catch((error: SumUpPayment) => console.error(error)); * @@ -114,11 +135,11 @@ export class SumUp extends IonicNativePlugin { * Login a user with an optional access token. * If the access token is provided and valid, the user is logged in autmatically. * Otherwise the user has to type in the credentials - * @param accessToken {string} + * @param sumUpKeys {SumUpKeys} * @return {Promise} Return a SumUpResponse object */ @Cordova() - login(accessToken?: string): Promise { + login(sumUpKeys: SumUpKeys): Promise { return; }