Skip to content

Commit

Permalink
feat: Add cards method to bloc class export
Browse files Browse the repository at this point in the history
  • Loading branch information
peoray committed Jan 30, 2024
1 parent a3c0f8d commit 4f8779d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/bloc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Transfers,
PaymentLinks,
Accounts,
Cards,
} from './services'

export class Bloc {
Expand All @@ -28,6 +29,7 @@ export class Bloc {
private transfers: Transfers
private paymentLinks: PaymentLinks
private accounts: Accounts
private cards: Cards

constructor(secretKey: string, publicKey: string) {
this.customer = new Customer(secretKey, publicKey)
Expand All @@ -43,6 +45,7 @@ export class Bloc {
this.transfers = new Transfers(secretKey, publicKey)
this.paymentLinks = new PaymentLinks(secretKey, publicKey)
this.accounts = new Accounts(secretKey, publicKey)
this.cards = new Cards(secretKey, publicKey)
}

public get createCustomer() {
Expand Down Expand Up @@ -222,4 +225,43 @@ export class Bloc {
public get reopenAccount() {
return this.accounts.reopenAccount.bind(this.accounts)
}
public get issueCard() {
return this.cards.issueCard.bind(this.cards)
}
public get getCards() {
return this.cards.getCards.bind(this.cards)
}
public get getCardById() {
return this.cards.getCardById.bind(this.cards)
}
public get getCustomerCards() {
return this.cards.getCustomerCards.bind(this.cards)
}
public get getCardSecureData() {
return this.cards.getCardSecureData.bind(this.cards)
}
public get changeCardPIN() {
return this.cards.changeCardPIN.bind(this.cards)
}
public get freezeCard() {
return this.cards.freezeCard.bind(this.cards)
}
public get unfreezeCard() {
return this.cards.unfreezeCard.bind(this.cards)
}
public get blockCard() {
return this.cards.blockCard.bind(this.cards)
}
public get linkCardwithFixedAccount() {
return this.cards.linkCardwithFixedAccount.bind(this.cards)
}
public get unlinkCardwithFixedAccount() {
return this.cards.unlinkCardwithFixedAccount.bind(this.cards)
}
public get fundCard() {
return this.cards.fundCard.bind(this.cards)
}
public get withdrawFromCard() {
return this.cards.withdrawFromCard.bind(this.cards)
}
}
1 change: 1 addition & 0 deletions src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export * from './disputes'
export * from './transfers'
export * from './payment-links'
export * from './accounts'
export * from './cards'

0 comments on commit 4f8779d

Please sign in to comment.