Skip to content

Commit 87764ed

Browse files
docs: improve examples
1 parent 130ab86 commit 87764ed

1 file changed

Lines changed: 178 additions & 73 deletions

File tree

lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountActivityListPageResponseTest.kt

Lines changed: 178 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -15,74 +15,144 @@ internal class AccountActivityListPageResponseTest {
1515
val accountActivityListPageResponse =
1616
AccountActivityListPageResponse.builder()
1717
.addData(
18-
AccountActivityListResponse.FinancialTransaction.builder()
19-
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
20-
.category(
21-
AccountActivityListResponse.FinancialTransaction.TransactionCategory.ACH
18+
Payment.builder()
19+
.token("bd4efddb-771b-49e3-9af9-49b077ab5eb8")
20+
.category(Payment.TransactionCategory.ACH)
21+
.created(OffsetDateTime.parse("2025-10-27T20:12:22Z"))
22+
.descriptor("ach_origination_credit")
23+
.direction(Payment.Direction.CREDIT)
24+
.addEvent(
25+
Payment.PaymentEvent.builder()
26+
.token("327dccc3-fe42-54d2-962c-7f8135805464")
27+
.amount(-1588L)
28+
.created(OffsetDateTime.parse("2025-10-27T20:12:22Z"))
29+
.result(Payment.PaymentEvent.Result.APPROVED)
30+
.type(
31+
Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED
32+
)
33+
.addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED)
34+
.externalId("external_id")
35+
.build()
2236
)
23-
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
24-
.currency("USD")
25-
.descriptor("descriptor")
2637
.addEvent(
27-
FinancialEvent.builder()
28-
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
29-
.amount(0L)
30-
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
31-
.result(FinancialEvent.Result.APPROVED)
32-
.type(FinancialEvent.FinancialEventType.ACH_ORIGINATION_CANCELLED)
38+
Payment.PaymentEvent.builder()
39+
.token("f9165477-7cfc-53c6-98f1-84e9ec856a60")
40+
.amount(-1588L)
41+
.created(OffsetDateTime.parse("2025-10-27T20:12:25Z"))
42+
.result(Payment.PaymentEvent.Result.APPROVED)
43+
.type(
44+
Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED
45+
)
46+
.addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED)
47+
.externalId("external_id")
3348
.build()
3449
)
35-
.family(AccountActivityListResponse.FinancialTransaction.Family.INTERNAL)
36-
.financialAccountToken("0cc87075-57cf-4607-8722-f42e2cb2c0cd")
37-
.pendingAmount(500L)
38-
.result(
39-
AccountActivityListResponse.FinancialTransaction.TransactionResult
40-
.APPROVED
50+
.family(Payment.Family.PAYMENT)
51+
.financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d")
52+
.method(Payment.Method.ACH_NEXT_DAY)
53+
.methodAttributes(
54+
Payment.MethodAttributes.AchMethodAttributes.builder()
55+
.secCode(Payment.MethodAttributes.AchMethodAttributes.SecCode.CCD)
56+
.achHoldPeriod(1L)
57+
.addenda(null)
58+
.companyId("1111111111")
59+
.overrideCompanyName("override_company_name")
60+
.receiptRoutingNumber(null)
61+
.retries(0L)
62+
.returnReasonCode(null)
63+
.addTraceNumber("string")
64+
.build()
4165
)
42-
.settledAmount(200L)
43-
.status(
44-
AccountActivityListResponse.FinancialTransaction.TransactionStatus
45-
.PENDING
66+
.pendingAmount(-1588L)
67+
.relatedAccountTokens(
68+
Payment.RelatedAccountTokens.builder()
69+
.accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
70+
.businessAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
71+
.build()
4672
)
47-
.updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
73+
.result(Payment.TransactionResult.APPROVED)
74+
.settledAmount(0L)
75+
.source(Payment.Source.LITHIC)
76+
.status(Payment.TransactionStatus.PENDING)
77+
.updated(OffsetDateTime.parse("2025-10-27T20:12:25Z"))
78+
.currency("USD")
79+
.expectedReleaseDate(null)
80+
.externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4")
81+
.type(Payment.TransferType.ORIGINATION_CREDIT)
82+
.userDefinedId(null)
4883
.build()
4984
)
5085
.hasMore(true)
5186
.build()
5287

5388
assertThat(accountActivityListPageResponse.data())
5489
.containsExactly(
55-
AccountActivityListResponse.ofInternal(
56-
AccountActivityListResponse.FinancialTransaction.builder()
57-
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
58-
.category(
59-
AccountActivityListResponse.FinancialTransaction.TransactionCategory.ACH
90+
AccountActivityListResponse.ofPayment(
91+
Payment.builder()
92+
.token("bd4efddb-771b-49e3-9af9-49b077ab5eb8")
93+
.category(Payment.TransactionCategory.ACH)
94+
.created(OffsetDateTime.parse("2025-10-27T20:12:22Z"))
95+
.descriptor("ach_origination_credit")
96+
.direction(Payment.Direction.CREDIT)
97+
.addEvent(
98+
Payment.PaymentEvent.builder()
99+
.token("327dccc3-fe42-54d2-962c-7f8135805464")
100+
.amount(-1588L)
101+
.created(OffsetDateTime.parse("2025-10-27T20:12:22Z"))
102+
.result(Payment.PaymentEvent.Result.APPROVED)
103+
.type(
104+
Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED
105+
)
106+
.addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED)
107+
.externalId("external_id")
108+
.build()
60109
)
61-
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
62-
.currency("USD")
63-
.descriptor("descriptor")
64110
.addEvent(
65-
FinancialEvent.builder()
66-
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
67-
.amount(0L)
68-
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
69-
.result(FinancialEvent.Result.APPROVED)
70-
.type(FinancialEvent.FinancialEventType.ACH_ORIGINATION_CANCELLED)
111+
Payment.PaymentEvent.builder()
112+
.token("f9165477-7cfc-53c6-98f1-84e9ec856a60")
113+
.amount(-1588L)
114+
.created(OffsetDateTime.parse("2025-10-27T20:12:25Z"))
115+
.result(Payment.PaymentEvent.Result.APPROVED)
116+
.type(
117+
Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED
118+
)
119+
.addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED)
120+
.externalId("external_id")
71121
.build()
72122
)
73-
.family(AccountActivityListResponse.FinancialTransaction.Family.INTERNAL)
74-
.financialAccountToken("0cc87075-57cf-4607-8722-f42e2cb2c0cd")
75-
.pendingAmount(500L)
76-
.result(
77-
AccountActivityListResponse.FinancialTransaction.TransactionResult
78-
.APPROVED
123+
.family(Payment.Family.PAYMENT)
124+
.financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d")
125+
.method(Payment.Method.ACH_NEXT_DAY)
126+
.methodAttributes(
127+
Payment.MethodAttributes.AchMethodAttributes.builder()
128+
.secCode(Payment.MethodAttributes.AchMethodAttributes.SecCode.CCD)
129+
.achHoldPeriod(1L)
130+
.addenda(null)
131+
.companyId("1111111111")
132+
.overrideCompanyName("override_company_name")
133+
.receiptRoutingNumber(null)
134+
.retries(0L)
135+
.returnReasonCode(null)
136+
.addTraceNumber("string")
137+
.build()
79138
)
80-
.settledAmount(200L)
81-
.status(
82-
AccountActivityListResponse.FinancialTransaction.TransactionStatus
83-
.PENDING
139+
.pendingAmount(-1588L)
140+
.relatedAccountTokens(
141+
Payment.RelatedAccountTokens.builder()
142+
.accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
143+
.businessAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
144+
.build()
84145
)
85-
.updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
146+
.result(Payment.TransactionResult.APPROVED)
147+
.settledAmount(0L)
148+
.source(Payment.Source.LITHIC)
149+
.status(Payment.TransactionStatus.PENDING)
150+
.updated(OffsetDateTime.parse("2025-10-27T20:12:25Z"))
151+
.currency("USD")
152+
.expectedReleaseDate(null)
153+
.externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4")
154+
.type(Payment.TransferType.ORIGINATION_CREDIT)
155+
.userDefinedId(null)
86156
.build()
87157
)
88158
)
@@ -95,36 +165,71 @@ internal class AccountActivityListPageResponseTest {
95165
val accountActivityListPageResponse =
96166
AccountActivityListPageResponse.builder()
97167
.addData(
98-
AccountActivityListResponse.FinancialTransaction.builder()
99-
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
100-
.category(
101-
AccountActivityListResponse.FinancialTransaction.TransactionCategory.ACH
168+
Payment.builder()
169+
.token("bd4efddb-771b-49e3-9af9-49b077ab5eb8")
170+
.category(Payment.TransactionCategory.ACH)
171+
.created(OffsetDateTime.parse("2025-10-27T20:12:22Z"))
172+
.descriptor("ach_origination_credit")
173+
.direction(Payment.Direction.CREDIT)
174+
.addEvent(
175+
Payment.PaymentEvent.builder()
176+
.token("327dccc3-fe42-54d2-962c-7f8135805464")
177+
.amount(-1588L)
178+
.created(OffsetDateTime.parse("2025-10-27T20:12:22Z"))
179+
.result(Payment.PaymentEvent.Result.APPROVED)
180+
.type(
181+
Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_INITIATED
182+
)
183+
.addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED)
184+
.externalId("external_id")
185+
.build()
102186
)
103-
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
104-
.currency("USD")
105-
.descriptor("descriptor")
106187
.addEvent(
107-
FinancialEvent.builder()
108-
.token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
109-
.amount(0L)
110-
.created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
111-
.result(FinancialEvent.Result.APPROVED)
112-
.type(FinancialEvent.FinancialEventType.ACH_ORIGINATION_CANCELLED)
188+
Payment.PaymentEvent.builder()
189+
.token("f9165477-7cfc-53c6-98f1-84e9ec856a60")
190+
.amount(-1588L)
191+
.created(OffsetDateTime.parse("2025-10-27T20:12:25Z"))
192+
.result(Payment.PaymentEvent.Result.APPROVED)
193+
.type(
194+
Payment.PaymentEvent.PaymentEventType.ACH_ORIGINATION_REVIEWED
195+
)
196+
.addDetailedResult(Payment.PaymentEvent.DetailedResult.APPROVED)
197+
.externalId("external_id")
113198
.build()
114199
)
115-
.family(AccountActivityListResponse.FinancialTransaction.Family.INTERNAL)
116-
.financialAccountToken("0cc87075-57cf-4607-8722-f42e2cb2c0cd")
117-
.pendingAmount(500L)
118-
.result(
119-
AccountActivityListResponse.FinancialTransaction.TransactionResult
120-
.APPROVED
200+
.family(Payment.Family.PAYMENT)
201+
.financialAccountToken("35b0c466-a3e3-519a-9549-ead6a6a2277d")
202+
.method(Payment.Method.ACH_NEXT_DAY)
203+
.methodAttributes(
204+
Payment.MethodAttributes.AchMethodAttributes.builder()
205+
.secCode(Payment.MethodAttributes.AchMethodAttributes.SecCode.CCD)
206+
.achHoldPeriod(1L)
207+
.addenda(null)
208+
.companyId("1111111111")
209+
.overrideCompanyName("override_company_name")
210+
.receiptRoutingNumber(null)
211+
.retries(0L)
212+
.returnReasonCode(null)
213+
.addTraceNumber("string")
214+
.build()
121215
)
122-
.settledAmount(200L)
123-
.status(
124-
AccountActivityListResponse.FinancialTransaction.TransactionStatus
125-
.PENDING
216+
.pendingAmount(-1588L)
217+
.relatedAccountTokens(
218+
Payment.RelatedAccountTokens.builder()
219+
.accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
220+
.businessAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
221+
.build()
126222
)
127-
.updated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
223+
.result(Payment.TransactionResult.APPROVED)
224+
.settledAmount(0L)
225+
.source(Payment.Source.LITHIC)
226+
.status(Payment.TransactionStatus.PENDING)
227+
.updated(OffsetDateTime.parse("2025-10-27T20:12:25Z"))
228+
.currency("USD")
229+
.expectedReleaseDate(null)
230+
.externalBankAccountToken("feb4fee1-2414-4c38-a5f6-9deac293c8f4")
231+
.type(Payment.TransferType.ORIGINATION_CREDIT)
232+
.userDefinedId(null)
128233
.build()
129234
)
130235
.hasMore(true)

0 commit comments

Comments
 (0)