Skip to content

Commit

Permalink
Merge pull request #381 from Mangopay/bugfix/banking-alias-fix
Browse files Browse the repository at this point in the history
fixed banking alias typings
  • Loading branch information
iulian03 authored Dec 6, 2023
2 parents 32852a2 + 60c6cc9 commit 76563f3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
9 changes: 7 additions & 2 deletions typings/mangopay2-nodejs-sdk-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,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
});
Expand All @@ -1077,7 +1079,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 => {
Expand Down
40 changes: 38 additions & 2 deletions typings/models/bankingAlias.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,43 @@ export namespace bankingAlias {
BIC: string;
}

interface CreateIBANBankingAlias extends PickPartialRequired<IBANBankingAliasData,
"Tag" | "CreditedUserId", "OwnerName" | "Country"> {
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;
}
}
2 changes: 1 addition & 1 deletion typings/services/BankingAliases.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class BankingAliases {
* @param bankingAliasId
* @param options
*/
update: MethodOverload<Partial<Omit<bankingAlias.CreateIBANBankingAlias, "CreditedUserId">>,
update: MethodOverload<bankingAlias.UpdateIBANBankingAlias,
bankingAlias.IBANBankingAliasData>;

/**
Expand Down

0 comments on commit 76563f3

Please sign in to comment.