Skip to content

Commit 23d7725

Browse files
authored
Create method for fetching card limits (#3) (#82)
Thanks!
1 parent 7911c8e commit 23d7725

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

resources/cards.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Card, CreateDebitCardRequest, PinStatus, ReplaceCardRequest } from "../types/cards"
1+
import { Card, CardLimits, CreateDebitCardRequest, PinStatus, ReplaceCardRequest } from "../types/cards"
22
import { Include, UnitConfig, UnitResponse } from "../types/common"
33
import { Customer } from "../types/customer"
44
import { Account } from "../types/account"
@@ -72,6 +72,10 @@ export class Cards extends BaseResource {
7272

7373
return await this.httpGet<UnitResponse<PinStatus>>(path)
7474
}
75+
76+
public async limits(id: string) : Promise<UnitResponse<CardLimits>> {
77+
return this.httpGet<UnitResponse<CardLimits>>(`/${id}/limits`)
78+
}
7579
}
7680

7781
export interface CardListParams {

types/cards.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,4 +525,27 @@ export interface PinStatus {
525525
attributes: {
526526
status: "Set" | "NotSet"
527527
}
528-
}
528+
}
529+
530+
export interface CardLimits {
531+
type: "limits"
532+
533+
attributes: {
534+
limits: {
535+
dailyWithdrawal: number
536+
dailyPurchase: number
537+
monthlyWithdrawal: number
538+
monthlyPurchase: number
539+
}
540+
dailyTotals: {
541+
withdrawals: number
542+
deposits: number
543+
purchases: number
544+
}
545+
monthlyTotals: {
546+
withdrawals: number
547+
deposits: number
548+
purchases: number
549+
}
550+
}
551+
}

0 commit comments

Comments
 (0)