Skip to content

Commit 78593e3

Browse files
authored
Merge pull request #57 from HiatusApp/main
few type fixes, add missing verifyCounterpartyBalance param
2 parents 3014e4f + f60fc3b commit 78593e3

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

resources/statements.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ export class Statments extends BaseResource {
1717
return this.httpGet<UnitResponse<Statement[]>>("", { params: parameters })
1818
}
1919

20-
public get(statementId: string, customerId?: string): Promise<UnitResponse<Statement>> {
20+
public get(statementId: string, customerId?: string): Promise<string> {
2121
const parameters = {
2222
...(customerId && { "filter[customerId]": customerId })
2323
}
2424

25-
return this.httpGet<UnitResponse<Statement>>(`/${statementId}/html`, {params: parameters})
25+
return this.httpGet<string>(`/${statementId}/html`, {params: parameters})
2626
}
2727
}
2828

types/payments.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface BasePaymentAttributes {
3434
/**
3535
* The amount (cents) of the payment.
3636
*/
37-
amount: string
37+
amount: number
3838

3939
/**
4040
* See [Tags](https://developers.unit.co/#tags).
@@ -130,12 +130,12 @@ interface BookPayment {
130130
* The Counterparty account the payment to be made to.
131131
*/
132132
counterpartyAccount: Relationship
133-
133+
134134
/**
135135
* The Customer the counterparty account belongs to.The customer is either a business or a individual.
136136
*/
137137
counterpartyCustomer: Relationship
138-
138+
139139
/**
140140
* The Book Transaction generated by this payment.
141141
*/
@@ -229,6 +229,11 @@ export interface CreateInlinePaymentRequest {
229229
*/
230230
idempotencyKey?: string
231231

232+
/**
233+
* Optional, default is false. Verify the counterparty balance, if balance verification fails the payment will be rejected with reason set to CounterpartyInsufficientFunds
234+
*/
235+
verifyCounterpartyBalance?: boolean
236+
232237
/**
233238
* See [Tags](https://developers.unit.co/#tags). Tags that will be copied to any transaction that this payment creates (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
234239
*/
@@ -273,6 +278,11 @@ export interface CreateLinkedPaymentRequest {
273278
*/
274279
idempotencyKey?: string
275280

281+
/**
282+
* Optional, default is false. Verify the counterparty balance, if balance verification fails the payment will be rejected with reason set to CounterpartyInsufficientFunds
283+
*/
284+
verifyCounterpartyBalance?: boolean
285+
276286
/**
277287
* See [Tags](https://developers.unit.co/#tags). Tags that will be copied to any transaction that this payment creates (see [Tag Inheritance](https://developers.unit.co/#tag-inheritance)).
278288
*/
@@ -321,6 +331,11 @@ export interface CreateVerifiedPaymentRequest {
321331
*/
322332
counterpartyName?: string
323333

334+
/**
335+
* Optional, default is false. Verify the counterparty balance, if balance verification fails the payment will be rejected with reason set to CounterpartyInsufficientFunds
336+
*/
337+
verifyCounterpartyBalance?: boolean
338+
324339
/**
325340
* See [Create Plaid processor token API](https://plaid.com/docs/api/processors/).
326341
*/
@@ -333,4 +348,4 @@ export interface CreateVerifiedPaymentRequest {
333348
*/
334349
account: Relationship
335350
}
336-
}
351+
}

0 commit comments

Comments
 (0)