Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed banking alias typings #381

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions typings/mangopay2-nodejs-sdk-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand All @@ -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 => {
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
Loading