diff --git a/package-lock.json b/package-lock.json index 408d8ced..5452ead6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@unit-finance/unit-node-sdk", - "version": "1.3.2", + "version": "1.3.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@unit-finance/unit-node-sdk", - "version": "1.3.2", + "version": "1.3.3", "license": "MPLv2", "dependencies": { "axios": "^1.8.4" diff --git a/package.json b/package.json index 2b88dfa4..92ef3621 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@unit-finance/unit-node-sdk", - "version": "1.3.2", + "version": "1.3.3", "description": "", "main": "dist/unit.js", "types": "dist/unit.d.ts", diff --git a/resources/receivedPayments.ts b/resources/receivedPayments.ts index bfee60bb..25cc0abc 100644 --- a/resources/receivedPayments.ts +++ b/resources/receivedPayments.ts @@ -18,6 +18,10 @@ export class ReceivedPayments extends BaseResource { return this.httpPost>(`/${id}/advance`) } + public async reprocess(id: string): Promise> { + return this.httpPost>(`/${id}/reprocess`) + } + /** * @param include * Optional. A comma-separated list of related resources to include in the response. diff --git a/tests/applications.spec.ts b/tests/applications.spec.ts index ebbf66cc..cebdc439 100644 --- a/tests/applications.spec.ts +++ b/tests/applications.spec.ts @@ -1,5 +1,3 @@ - - import { createAddress, createFullName, createPhone } from "../helpers" import { Agent, diff --git a/tests/statements.spec.ts b/tests/statements.spec.ts index 1a679985..db61a592 100644 --- a/tests/statements.spec.ts +++ b/tests/statements.spec.ts @@ -7,7 +7,7 @@ const statementId: string[] = [] describe("Statements List", () => { test("Get Statements List", async () => { - const params: StatementsListParams = { limit: 50 } + const params: StatementsListParams = { limit: 35 } const res = await unit.statements.list(params) expect(res.data.length).toBeGreaterThan(0) res.data.forEach(element => { @@ -15,7 +15,7 @@ describe("Statements List", () => { statementId.push(element.id) } }) - }) + }, 120000) }) describe("Get Statement Test", () => { diff --git a/tests/testHelpers.ts b/tests/testHelpers.ts index e3faa435..12ad89bd 100644 --- a/tests/testHelpers.ts +++ b/tests/testHelpers.ts @@ -77,9 +77,9 @@ export function createBusinessApplication(unit: Unit) { contact: createBusinessContact(createFullName("Jone", "Doe"), "jone.doe@unit-finance.com", createPhone("1", "2025550108")), beneficialOwners: [ createBeneficialOwner(null, createFullName("James", "Smith"), "574567625", null, null, "2012-04-05", - createAddress("650 Allerton Street", null, "Redwood City", "CA", "94063", "US"), createPhone("1", "2025550127"), "james@unit-finance.com", null), + createAddress("650 Allerton Street", null, "Redwood City", "CA", "94063", "US"), createPhone("1", "2025550127"), "james@unit-finance.com", 60), createBeneficialOwner(null, createFullName("Richard", "Hendricks"), "574572795", null, null, "2012-04-03", - createAddress("470 Allerton Street", null, "Redwood City", "CA", "94063", "US"), createPhone("1", "2025550158"), "richard@unit-finance.com", null) + createAddress("470 Allerton Street", null, "Redwood City", "CA", "94063", "US"), createPhone("1", "2025550158"), "richard@unit-finance.com", 40) ], businessVertical: "Construction", yearOfIncorporation: "1999" diff --git a/types/payments.ts b/types/payments.ts index 9973df42..e397c52f 100644 --- a/types/payments.ts +++ b/types/payments.ts @@ -204,7 +204,7 @@ export interface WirePayment { relationships: BasePaymentRelationships } -export type ReceivedPaymentStatus = "Pending" | "Advanced" | "Completed" | "Returned" +export type ReceivedPaymentStatus = "Pending" | "PendingReview" | "MarkedForReturn" | "Advanced" | "Completed" | "Returned" export interface AchReceivedPayment { /** diff --git a/types/transactions.ts b/types/transactions.ts index 97613019..36966aec 100644 --- a/types/transactions.ts +++ b/types/transactions.ts @@ -1,7 +1,7 @@ import { Address, CardNetwork, Coordinates, Counterparty, CurrencyConversion, Direction, Merchant, Relationship, RelationshipsArray, RichMerchantData, Tags, UnimplementedFields } from "./common" export type Transaction = OriginatedAchTransaction | ReceivedAchTransaction | ReturnedAchTransaction | ReturnedReceivedAchTransaction | DishonoredAchTransaction | BookTransaction | PurchaseTransaction | AtmTransaction | FeeTransaction | FeeReversalTransaction | - CardReversalTransaction | CardTransaction | WireTransaction | ReleaseTransaction | AdjustmentTransaction | InterestTransaction | DisputeTransaction | CheckDepositTransaction | CheckPaymentTransaction | ReturnedCheckDepositTransaction | PaymentAdvanceTransaction | + CardReversalTransaction | CardTransaction | WireTransaction | ReturnedWireTransaction | ReleaseTransaction | AdjustmentTransaction | InterestTransaction | DisputeTransaction | CheckDepositTransaction | CheckPaymentTransaction | ReturnedCheckDepositTransaction | ReturnedCheckPaymentTransaction | PaymentAdvanceTransaction | RepaidPaymentAdvanceTransaction | PaymentCanceledTransaction | RewardTransaction | NegativeBalanceCoverageTransaction | PushToCardTransaction | AccountLowBalanceClosureTransaction | BankRepaymentTransaction export interface BaseTransaction { @@ -500,6 +500,11 @@ export type AtmTransaction = BaseTransaction & { * The debit card involved in the transaction. */ card: Relationship + + /** + * Optional. The [Authorization](https://developers.unit.co/#authorization) request made by the merchant, if present (see [Authorizations](https://developers.unit.co/#authorizations)). + */ + authorization?: Relationship } } @@ -662,6 +667,43 @@ export type WireTransaction = BaseTransaction & { } } +export type ReturnedWireTransaction = BaseTransaction & { + /** + * Type of the transaction resource. The value is always returnedWireTransaction. + */ + type: "returnedWireTransaction" + + /** + * JSON object representing the transaction data. + */ + attributes: { + /** + * The reason for the return. + */ + reason: string + + /** + * Input Message Accountability Data. It's a unique number given to each FedWire payment in case of payment has been sent and fully processed. + */ + imad: string + + /** + * Optional. Output Message Accountability Data. It's a unique number given to each FedWire payment in case of payment has been sent and fully processed. + */ + omad?: string + } + + /** + * Describes relationships between the transaction resource and other resources (account and customer). + */ + relationships: { + /** + * The payment belonging to this transaction. + */ + payment: Relationship + } +} + export type ReleaseTransaction = BaseTransaction & { /** * Type of the transaction resource. The value is always releaseTransaction. @@ -813,6 +855,33 @@ export type ReturnedCheckDepositTransaction = BaseTransaction & { } } +export type ReturnedCheckPaymentTransaction = BaseTransaction & { + /** + * Type of the transaction resource. The value is always returnedCheckPaymentTransaction. + */ + type: "returnedCheckPaymentTransaction" + + /** + * JSON object representing the transaction data. + */ + attributes: { + /** + * The reason for the transaction return. This is a replacement to the deprecated `reason` attribute. + */ + returnReason: string + } + + /** + * Describes relationships between the transaction resource and other resources (account, customer, checkDeposit). + */ + relationships: { + /** + * The [Check Payment](https://developers.unit.co/resources/#transaction-check-payment) the transaction is related to. + */ + checkPayment: Relationship + } +} + export type PaymentAdvanceTransaction = BaseTransaction & { /** * Type of the transaction resource. The value is always paymentAdvanceTransaction.