Skip to content

Commit

Permalink
Update the bank-redirect d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberxander90 committed Feb 17, 2022
1 parent 9fdb167 commit 01279dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 6 additions & 1 deletion lib/recurly/bank-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function factory (options) {
}

/**
* Initializes an BankRedirect session.
* Initializes a BankRedirect session.
*
* @param {Object} options
* @param {Recurly} options.recurly
Expand Down Expand Up @@ -58,6 +58,11 @@ class BankRedirect extends Emitter {
});
}

/**
* Fetch the countries.
* @param {Object} data
* @param {string} attachTo
*/
loadCountries (data, attachTo) {
debug('Load countries');

Expand Down
15 changes: 10 additions & 5 deletions types/lib/bank-redirect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,35 @@ export type BankRedirectOptions = {
country_code?: string;

/**
* Invoice Uuid from PendingPurchase
* Invoice Uuid from PendingPurchase.
*/
invoice_uuid: string;
};

export type LoadBankOptions = {
export type LoadBanksOptions = {
/**
* Token Payment method type.
*/
payment_method_type: PaymentMethodType;
};

export type LoadCountriesOptions = LoadBanksOptions;

export interface BankRedirectInstance extends Emitter<BankRedirectEvent> {
/**
* Start the BankRedirect Payment Modal.
*/
start: (data: BankRedirectOptions) => void;

/**
* Load the banks.
* Load the banks for the specified payment method type.
*/
loadBanks: (data: LoadBankOptions, attachTo?: string) => void;
loadBanks: (data: LoadBanksOptions, attachTo?: string) => void;

loadCountries: (attachTo?: string) => void;
/**
* Load the countries for the specified payment method type.
*/
loadCountries: (data: LoadCountriesOptions, attachTo?: string) => void;
}

export type BankRedirect = () => BankRedirectInstance;

0 comments on commit 01279dc

Please sign in to comment.