Skip to content

Commit c988fcd

Browse files
Clear ach payment and version bump to 1.2.1 (#495)
* feat: clear ach payment * version bump to 1.2.1 * fix: incorrect date in orgToken tests --------- Co-authored-by: Josh Cockrell <[email protected]>
1 parent cb947bc commit c988fcd

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@unit-finance/unit-node-sdk",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "",
55
"main": "dist/unit.js",
66
"types": "dist/unit.d.ts",

resources/simulations.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BaseResource } from "."
2-
import { AtmAuthorizationRequest, AtmTransaction, AtmWithdrawalRequestSimulation, CardTransactionAuthorizationRequest, CheckPayment, CreateAtmAuthorizationRequestSimulation,
2+
import { AtmAuthorizationRequest, AtmTransaction, AtmWithdrawalRequestSimulation, CardTransactionAuthorizationRequest, CheckPayment, ClearAchPaymentSimulation, CreateAtmAuthorizationRequestSimulation,
33
CreateCardPurchaseAuthorizationRequestSimulation, CreateCardTransactionAuthorizationRequestSimulation, CreateCheckPaymentSimulation, PurchaseAuthorizationRequest, Relationship, TransmitAchPaymentSimulation, UnitConfig, UnitResponse } from "../types"
44
import { AchReceivedPayment, Application, ApplicationDocument, AchPayment } from "../types"
55
import {
@@ -106,6 +106,14 @@ export class Simulations extends BaseResource {
106106
})
107107
}
108108

109+
public async clearAchPayment(
110+
request: ClearAchPaymentSimulation
111+
): Promise<UnitResponse<AchPayment>> {
112+
return this.httpPost<UnitResponse<AchPayment>>("/ach/clear", {
113+
data: request,
114+
})
115+
}
116+
109117
public async createCheckPayment(request: CreateCheckPaymentSimulation): Promise<UnitResponse<CheckPayment>> {
110118
return this.httpPost<UnitResponse<CheckPayment>>("/check-payments", { data: request} )
111119
}

tests/orgTokens.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ const unit = new Unit(process.env.UNIT_TOKEN || "test", process.env.UNIT_API_URL
66

77
const resource: RestrictedResource = {ids: ["121"] , type: "account"}
88

9+
910
describe("Create API Tokens", () => {
1011
test("Create API Tokens", async () => {
1112
const req: CreateApiTokenRequest = {
1213
"type": "apiToken",
1314
"attributes": {
1415
"description": "test token",
1516
"scope": "customers applications",
16-
"expiration": "2024-09-01T13:47:17.000Z",
17+
"expiration": "2025-09-01T13:47:17.000Z",
1718
"resources": [resource]
1819
}
1920
}

types/simulations.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ export interface ClearAchPaymentSimulation {
5555
type: "clearAchPayment"
5656
relationships: {
5757
payment: {
58-
type: "achPayment"
59-
id: string
58+
data: {
59+
type: "achPayment"
60+
id: string
61+
}
6062
}
6163
}
6264
}

0 commit comments

Comments
 (0)