From cafd61e6bd59cc78a2b63683831497c11858385e Mon Sep 17 00:00:00 2001 From: Michael Ossig Date: Fri, 7 Mar 2025 12:31:30 -0500 Subject: [PATCH 1/2] adds cashed, payment method, and data_as_of --- src/resources/Account/types.ts | 1 + src/resources/Payment/types.ts | 9 +++++++++ test/resources/Account.tests.ts | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/resources/Account/types.ts b/src/resources/Account/types.ts index 485242d..c9d87e8 100644 --- a/src/resources/Account/types.ts +++ b/src/resources/Account/types.ts @@ -410,6 +410,7 @@ export interface IAccountUpdate { insurance?: IAccountLiabilityInsurance; medical?: IAccountLiabilityMedical; utility?: IAccountLiabilityUtility; + data_as_of: string | null; error: IResourceError | null; created_at: string; updated_at: string; diff --git a/src/resources/Payment/types.ts b/src/resources/Payment/types.ts index e5e04b7..9030b9c 100644 --- a/src/resources/Payment/types.ts +++ b/src/resources/Payment/types.ts @@ -11,6 +11,7 @@ export const PaymentStatuses = { reversal_required: 'reversal_required', reversal_processing: 'reversal_processing', settled: 'settled', + cashed: 'cashed', } as const; export type TPaymentStatuses = keyof typeof PaymentStatuses; @@ -42,6 +43,13 @@ export const PaymentFeeTypes = { export type TPaymentFeeTypes = keyof typeof PaymentFeeTypes; +export const PaymentDestinationPaymentMethods = { + paper: 'paper', + electronic: 'electronic', +} as const; + +export type TPaymentDestinationPaymentMethods = keyof typeof PaymentDestinationPaymentMethods; + export interface IPaymentFee { type: TPaymentFeeTypes; amount: number; @@ -65,6 +73,7 @@ export interface IPayment { destination_settlement_date: string | null; source_status: TPaymentStatuses; destination_status: TPaymentStatuses; + destination_payment_method?: TPaymentDestinationPaymentMethods | null; fee: IPaymentFee | null type: TPaymentTypes; created_at: string; diff --git a/test/resources/Account.tests.ts b/test/resources/Account.tests.ts index 3bd9824..d42b6d1 100644 --- a/test/resources/Account.tests.ts +++ b/test/resources/Account.tests.ts @@ -76,12 +76,14 @@ describe('Accounts - core methods tests', () => { holder_id: holder_1_response.id, "liability.type": 'credit_card', "liability.mch_id": "mch_302086", + "status": "active", }))[0]; - + test_auto_loan_account = (await client.accounts.list({ holder_id: holder_1_response.id, "liability.type": 'auto_loan', "liability.mch_id": "mch_2347", + "status": "active", }))[0]; }); @@ -850,6 +852,7 @@ describe('Accounts - core methods tests', () => { credit_limit: null, usage_pattern: null }, + data_as_of: null, error: null, created_at: create_updates_response.created_at, updated_at: create_updates_response.updated_at @@ -890,6 +893,7 @@ describe('Accounts - core methods tests', () => { credit_limit: 2800000, usage_pattern: null }, + data_as_of: null, error: null, created_at: retrieve_updates_response.created_at, updated_at: retrieve_updates_response.updated_at @@ -925,6 +929,7 @@ describe('Accounts - core methods tests', () => { credit_limit: 2800000, usage_pattern: null }, + data_as_of: null, error: null, created_at: update_to_check?.created_at || '', updated_at: update_to_check?.updated_at || '' From c951cdc4cd4a33881ddfc453e94ba9a6486b5446 Mon Sep 17 00:00:00 2001 From: Michael Ossig Date: Fri, 7 Mar 2025 12:37:21 -0500 Subject: [PATCH 2/2] version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4b1aa4..383d222 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "method-node", - "version": "1.1.9", + "version": "1.1.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "method-node", - "version": "1.1.9", + "version": "1.1.10", "license": "ISC", "dependencies": { "axios": "^1.7.4", diff --git a/package.json b/package.json index 0a6a051..8882b58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "method-node", - "version": "1.1.9", + "version": "1.1.10", "description": "Node.js library for the Method API", "main": "dist/index.ts", "module": "dist/index.mjs",