From 60c6cc96e682578ff18f9edfd7373de001b6cbcd Mon Sep 17 00:00:00 2001 From: Iulian Masar Date: Wed, 6 Dec 2023 11:12:37 +0200 Subject: [PATCH] fixed banking alias typings --- typings/mangopay2-nodejs-sdk-tests.ts | 9 ++++-- typings/models/bankingAlias.d.ts | 40 +++++++++++++++++++++++++-- typings/services/BankingAliases.d.ts | 2 +- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/typings/mangopay2-nodejs-sdk-tests.ts b/typings/mangopay2-nodejs-sdk-tests.ts index a8d6b1f..92325fe 100644 --- a/typings/mangopay2-nodejs-sdk-tests.ts +++ b/typings/mangopay2-nodejs-sdk-tests.ts @@ -1052,7 +1052,9 @@ api.Transfers.getRefunds("transfer-id").then(data => { api.BankingAliases.create({ Country: "GB", - OwnerName: "owner-id" + OwnerName: "owner-id", + Type: 'IBAN', + WalletId: '1234' }).then(data => { const d = data; // $ExpectType IBANBankingAliasData }); @@ -1062,7 +1064,10 @@ api.BankingAliases.get("alias-id").then(data => { api.BankingAliases.getAll().then(data => { const d = data; // $ExpectType IBANBankingAliasData[] }); -api.BankingAliases.update({OwnerName: "some-name"}).then(data => { +api.BankingAliases.update({ + Id: '1234', + Active: false +}).then(data => { const d = data; // $ExpectType IBANBankingAliasData }); api.BankingAliases.deactivate("alias-id").then(data => { diff --git a/typings/models/bankingAlias.d.ts b/typings/models/bankingAlias.d.ts index 0d9ffe0..58cd8f2 100644 --- a/typings/models/bankingAlias.d.ts +++ b/typings/models/bankingAlias.d.ts @@ -53,7 +53,43 @@ export namespace bankingAlias { BIC: string; } - interface CreateIBANBankingAlias extends PickPartialRequired { + interface CreateIBANBankingAlias { + /** + * The type of banking alias (note that only IBAN is available at present) + */ + Type: "IBAN"; + + /** + * The ID of a wallet + */ + WalletId: string; + + /** + * The owner of the wallet/banking alias + */ + OwnerName: string; + + /** + * The Country of the Address + */ + Country: CountryISO; + + /** + * Custom data that you can add to this object + */ + Tag?: string; + } + + interface UpdateIBANBankingAlias { + /** + * The ID of the BankingAlias + */ + Id: string; + + /** + * Whether the banking alias is active or not + * Caution: Setting this value to false is irreversible + */ + Active?: boolean; } } diff --git a/typings/services/BankingAliases.d.ts b/typings/services/BankingAliases.d.ts index b7c176e..af2f80d 100644 --- a/typings/services/BankingAliases.d.ts +++ b/typings/services/BankingAliases.d.ts @@ -31,7 +31,7 @@ export class BankingAliases { * @param bankingAliasId * @param options */ - update: MethodOverload>, + update: MethodOverload; /**