From 01279dc4a5b16e5751eedda833982fe059ef2fd2 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 17 Feb 2022 11:15:51 -0300 Subject: [PATCH] Update the bank-redirect d.ts --- lib/recurly/bank-redirect.js | 7 ++++++- types/lib/bank-redirect.d.ts | 15 ++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/recurly/bank-redirect.js b/lib/recurly/bank-redirect.js index b62f86186..65a205d9a 100644 --- a/lib/recurly/bank-redirect.js +++ b/lib/recurly/bank-redirect.js @@ -14,7 +14,7 @@ export function factory (options) { } /** - * Initializes an BankRedirect session. + * Initializes a BankRedirect session. * * @param {Object} options * @param {Recurly} options.recurly @@ -58,6 +58,11 @@ class BankRedirect extends Emitter { }); } + /** + * Fetch the countries. + * @param {Object} data + * @param {string} attachTo + */ loadCountries (data, attachTo) { debug('Load countries'); diff --git a/types/lib/bank-redirect.d.ts b/types/lib/bank-redirect.d.ts index e3838620a..7a33b087e 100644 --- a/types/lib/bank-redirect.d.ts +++ b/types/lib/bank-redirect.d.ts @@ -21,18 +21,20 @@ 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 { /** * Start the BankRedirect Payment Modal. @@ -40,11 +42,14 @@ export interface BankRedirectInstance extends Emitter { 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;