Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions resources/receivedPayments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export class ReceivedPayments extends BaseResource {
return this.httpPost<UnitResponse<AchReceivedPayment>>(`/${id}/advance`)
}

public async reprocess(id: string): Promise<UnitResponse<AchReceivedPayment>> {
return this.httpPost<UnitResponse<AchReceivedPayment>>(`/${id}/reprocess`)
}

/**
* @param include
* Optional. A comma-separated list of related resources to include in the response.
Expand Down
2 changes: 0 additions & 2 deletions tests/applications.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import { createAddress, createFullName, createPhone } from "../helpers"
import {
Agent,
Expand All @@ -10,7 +8,7 @@
CreateSoleProprietorApplicationRequest,
IndividualApplication,
PatchApplicationRequest,
PatchBusinessApplicationAttributes,

Check warning on line 11 in tests/applications.spec.ts

View workflow job for this annotation

GitHub Actions / build

'PatchBusinessApplicationAttributes' is defined but never used
PatchBusinessApplicationBeneficialOwner,
RelationshipsArrayData,
Unit,
Expand Down
4 changes: 2 additions & 2 deletions tests/statements.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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 => {
if(element.relationships.customer){
statementId.push(element.id)
}
})
})
}, 120000)
})

describe("Get Statement Test", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/testHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export function createBusinessApplication(unit: Unit) {
contact: createBusinessContact(createFullName("Jone", "Doe"), "[email protected]", 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"), "[email protected]", null),
createAddress("650 Allerton Street", null, "Redwood City", "CA", "94063", "US"), createPhone("1", "2025550127"), "[email protected]", 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"), "[email protected]", null)
createAddress("470 Allerton Street", null, "Redwood City", "CA", "94063", "US"), createPhone("1", "2025550158"), "[email protected]", 40)
],
businessVertical: "Construction",
yearOfIncorporation: "1999"
Expand Down
2 changes: 1 addition & 1 deletion types/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
71 changes: 70 additions & 1 deletion types/transactions.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down