diff --git a/package-lock.json b/package-lock.json index 81b4bc26..616b95c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -797,9 +797,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz", - "integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.5.0.tgz", + "integrity": "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ==", "dev": true, "license": "MIT", "engines": { @@ -5685,9 +5685,9 @@ } }, "node_modules/prettier-eslint-cli/node_modules/ansi-regex": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz", - "integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.5.0.tgz", + "integrity": "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ==", "dev": true, "license": "MIT", "engines": { diff --git a/src/services/billingRequestService.ts b/src/services/billingRequestService.ts index b9142eb2..2f4bc9b6 100644 --- a/src/services/billingRequestService.ts +++ b/src/services/billingRequestService.ts @@ -11,6 +11,9 @@ interface BillingRequestListResponse extends Types.APIResponse { } interface BillingRequestCreateRequest { + // + account_information_request?: Types.BillingRequestAccountInformationRequest; + // (Optional) If true, this billing request can fallback from instant payment to // direct debit. // Should not be set if GoCardless payment intelligence feature is used. diff --git a/src/types/Types.ts b/src/types/Types.ts index 41f957e8..382b5eab 100644 --- a/src/types/Types.ts +++ b/src/types/Types.ts @@ -287,6 +287,9 @@ export enum BankDetailsLookupPayerNameVerificationResult { /** Type for a billingrequest resource. */ export type BillingRequest = { + // Request for account information + account_information_request?: BillingRequestAccountInformationRequest | null; + // List of actions that can be performed before this billing request can be // fulfilled. actions?: BillingRequestAction[]; @@ -554,6 +557,20 @@ export enum BillingRequestNotificationType { Email = 'email', } +/** Type for a billingrequestaccountinformationrequest resource. */ +export type BillingRequestAccountInformationRequest = { + // ISO 3166-1 alpha-2 code. + // (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + country_code: string; + + // List of scopes for the account information request + scopes: `${BillingRequestAccountInformationRequestScope}`[]; +}; + +export enum BillingRequestAccountInformationRequestScope { + AccountVerification = 'account_verification', +} + /** Type for a billingrequestaction resource. */ export type BillingRequestAction = { // List of country codes supported for collecting bank account details, for @@ -790,6 +807,9 @@ export type BillingRequestInstalmentScheduleRequestLinks = { /** Type for a billingrequestlinks resource. */ export type BillingRequestLinks = { + // (Optional) ID of associated account information request + account_information_request?: string; + // (Optional) ID of the bank authorisation // (https://docs.gocardless.com/docs/api-reference/bank-authorisation) that // was used to verify this request. @@ -2494,6 +2514,9 @@ export type BillingRequestWithActionBankAuthorisationsLinks = { /** Type for a billingrequestwithactionbillingrequests resource. */ export type BillingRequestWithActionBillingRequests = { + // Request for account information + account_information_request?: BillingRequestWithActionBillingRequestsAccountInformationRequest | null; + // List of actions that can be performed before this billing request can be // fulfilled. actions?: BillingRequestWithActionBillingRequestsAction[]; @@ -2761,6 +2784,20 @@ export enum BillingRequestWithActionBillingRequestsNotificationType { Email = 'email', } +/** Type for a billingrequestwithactionbillingrequestsaccountinformationrequest resource. */ +export type BillingRequestWithActionBillingRequestsAccountInformationRequest = { + // ISO 3166-1 alpha-2 code. + // (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + country_code: string; + + // List of scopes for the account information request + scopes: `${BillingRequestWithActionBillingRequestsAccountInformationRequestScope}`[]; +}; + +export enum BillingRequestWithActionBillingRequestsAccountInformationRequestScope { + AccountVerification = 'account_verification', +} + /** Type for a billingrequestwithactionbillingrequestsaction resource. */ export type BillingRequestWithActionBillingRequestsAction = { // List of country codes supported for collecting bank account details, for @@ -2997,6 +3034,9 @@ export type BillingRequestWithActionBillingRequestsInstalmentScheduleRequestLink /** Type for a billingrequestwithactionbillingrequestslinks resource. */ export type BillingRequestWithActionBillingRequestsLinks = { + // (Optional) ID of associated account information request + account_information_request?: string; + // (Optional) ID of the bank authorisation // (https://docs.gocardless.com/docs/api-reference/bank-authorisation) that // was used to verify this request.