Skip to content

Commit 1282cec

Browse files
ilyamermanLucasLemanowiczjohnson-relayaxshani
authored
0.37.0 (#410)
* Upgrade `axios` and `semver` versions (#409) * Fix axios security vulnerability * Fix semver vulnerability * Add missing link and disputeType fields to Dispute object (#408) * Add missing link and disputeType fields to Dispute object * Revert accidental deltion of decisionReason * - cancel check payment (#406) - update check payment statuses - added a test Co-authored-by: ilyamerman <[email protected]> * 0.37.0 --------- Co-authored-by: Lucas Lemanowicz <[email protected]> Co-authored-by: johnson-relay <[email protected]> Co-authored-by: Alex Shani <[email protected]>
1 parent b60f4b0 commit 1282cec

File tree

7 files changed

+179
-41
lines changed

7 files changed

+179
-41
lines changed

package-lock.json

Lines changed: 146 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@unit-finance/unit-node-sdk",
3-
"version": "0.36.1",
3+
"version": "0.37.0",
44
"description": "",
55
"main": "dist/unit.js",
66
"types": "dist/unit.d.ts",
@@ -33,6 +33,6 @@
3333
"typescript": "^4.2.4"
3434
},
3535
"dependencies": {
36-
"axios": "^0.26.1"
36+
"axios": "^1.6.2"
3737
}
3838
}

resources/baseResource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axiosStatic, {
22
AxiosInstance,
33
AxiosRequestConfig,
4-
AxiosRequestHeaders,
4+
RawAxiosRequestHeaders,
55
responseEncoding,
66
ResponseType
77
} from "axios"
@@ -13,7 +13,7 @@ const MAX_REQUEST_SIZE = 20000000
1313

1414
export class BaseResource {
1515
private resourcePath: string
16-
private headers: AxiosRequestHeaders
16+
private headers: RawAxiosRequestHeaders
1717
private readonly axios: AxiosInstance
1818

1919
constructor(token: string, resourcePath: string, config?: UnitConfig) {

resources/checkPayments.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ export class CheckPayments extends BaseResource {
5656

5757
return this.httpGet<UnitResponse<CheckPayment[]> & CheckPaymentIncluded & Meta>("", { params: parameters })
5858
}
59+
60+
public async cancel(id: string): Promise<UnitResponse<CheckPayment>> {
61+
return this.httpPost<UnitResponse<CheckPayment>>(`/${id}/cancel`)
62+
}
5963
}
6064

6165
export interface CheckPaymentListParams extends BaseCheckPaymentListParams {

0 commit comments

Comments
 (0)