Skip to content
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
14 changes: 14 additions & 0 deletions resources/billPays.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Biller, GetBillerParams } from "../types/billPay"
import { UnitConfig, UnitResponse } from "../types/common"
import { BaseResource } from "./baseResource"

export class BillPays extends BaseResource {

constructor(token: string, basePath: string, config?: UnitConfig) {
super(token, basePath + "/payments/billpay/billers", config)
}

public async get(params: GetBillerParams): Promise<UnitResponse<Biller[]>> {
return await this.httpGet<UnitResponse<Biller[]>>("", {params: params})
}
}
1 change: 1 addition & 0 deletions resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export * from "./returns"
export * from "./statements"
export * from "./transactions"
export * from "./webhooks"
export * from "./billPays"

38 changes: 38 additions & 0 deletions types/billPay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export interface Biller {
/**
* Type of the biller resource. The value is always biller.
*/
type: "biller"

/**
* Identifier of the biller resource.
*/
id: string

/**
* JSON object representing the biller data.
*/
attributes: {
/**
* Name of the biller.
*/
name: string

/**
* The category this biller is belong to.
*/
category: string
}
}

export interface GetBillerParams {
/**
* Optional. Determine the results page number.
*/
page?: number

/**
* Filter the name of the biller (full or partial).
*/
name: string
}
1 change: 1 addition & 0 deletions types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ export * from "./payments"
export * from "./returns"
export * from "./transactions"
export * from "./webhooks"
export * from "./billPay"
3 changes: 3 additions & 0 deletions unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Statments } from "./resources/statements"
import { Returns } from "./resources/returns"
import { ApplicationForms } from "./resources/applicationForm"
import { AccountsEndOfDay } from "./resources/accountEndOfDay"
import { BillPays } from "./resources"

export class Unit {
public applications: Applications
Expand All @@ -39,6 +40,7 @@ export class Unit {
public events: Events
public applicationForms: ApplicationForms
public returns: Returns
public billPays: BillPays

constructor(token: string, basePath: string, config?: UnitConfig) {
// remove all trailing slashes from user-provided basePath
Expand All @@ -62,6 +64,7 @@ export class Unit {
this.statements = new Statments(token, basePath, config)
this.applicationForms = new ApplicationForms(token, basePath, config)
this.returns = new Returns(token, basePath, config)
this.billPays = new BillPays(token, basePath, config)
this.helpers = helpers
}

Expand Down