Skip to content

Commit adf21e8

Browse files
feat(api): Add merchant location fields to simulator endpoints
1 parent 43846da commit adf21e8

6 files changed

Lines changed: 119 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 175
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a6c56df3bc156ac1e6ee5d635c6cd964f0d60836fe17a97deec8af8429bd339c.yml
3-
openapi_spec_hash: c563acd10d96ddabe6c9643b592bd509
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ce2adff9b644ed4562b5342a4a43d0b40c98d43b4e063b4626f4ca5d342f1b92.yml
3+
openapi_spec_hash: fbc84b866ce96457261ac58b4e75c71d
44
config_hash: 31d71922d7838f34ae0875c9b8026d99

src/lithic/resources/transactions/transactions.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,10 @@ def simulate_authorization(
244244
descriptor: str,
245245
pan: str,
246246
mcc: str | Omit = omit,
247+
merchant_acceptor_city: str | Omit = omit,
248+
merchant_acceptor_country: str | Omit = omit,
247249
merchant_acceptor_id: str | Omit = omit,
250+
merchant_acceptor_state: str | Omit = omit,
248251
merchant_amount: int | Omit = omit,
249252
merchant_currency: str | Omit = omit,
250253
partial_approval_capable: bool | Omit = omit,
@@ -289,8 +292,14 @@ def simulate_authorization(
289292
listed in ISO 18245. Supported merchant category codes can be found
290293
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
291294
295+
merchant_acceptor_city: Merchant acceptor city
296+
297+
merchant_acceptor_country: Merchant acceptor country code (ISO 3166-1 alpha-3)
298+
292299
merchant_acceptor_id: Unique identifier to identify the payment card acceptor.
293300
301+
merchant_acceptor_state: Merchant acceptor state/province (ISO 3166-2 subdivision code)
302+
294303
merchant_amount: Amount of the transaction to be simulated in currency specified in
295304
merchant_currency, including any acquirer fees.
296305
@@ -336,7 +345,10 @@ def simulate_authorization(
336345
"descriptor": descriptor,
337346
"pan": pan,
338347
"mcc": mcc,
348+
"merchant_acceptor_city": merchant_acceptor_city,
349+
"merchant_acceptor_country": merchant_acceptor_country,
339350
"merchant_acceptor_id": merchant_acceptor_id,
351+
"merchant_acceptor_state": merchant_acceptor_state,
340352
"merchant_amount": merchant_amount,
341353
"merchant_currency": merchant_currency,
342354
"partial_approval_capable": partial_approval_capable,
@@ -462,7 +474,10 @@ def simulate_credit_authorization(
462474
descriptor: str,
463475
pan: str,
464476
mcc: str | Omit = omit,
477+
merchant_acceptor_city: str | Omit = omit,
478+
merchant_acceptor_country: str | Omit = omit,
465479
merchant_acceptor_id: str | Omit = omit,
480+
merchant_acceptor_state: str | Omit = omit,
466481
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
467482
# The extra values given here take precedence over values defined on the client or passed to this method.
468483
extra_headers: Headers | None = None,
@@ -488,8 +503,14 @@ def simulate_credit_authorization(
488503
listed in ISO 18245. Supported merchant category codes can be found
489504
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
490505
506+
merchant_acceptor_city: Merchant acceptor city
507+
508+
merchant_acceptor_country: Merchant acceptor country code (ISO 3166-1 alpha-3)
509+
491510
merchant_acceptor_id: Unique identifier to identify the payment card acceptor.
492511
512+
merchant_acceptor_state: Merchant acceptor state/province (ISO 3166-2 subdivision code)
513+
493514
extra_headers: Send extra headers
494515
495516
extra_query: Add additional query parameters to the request
@@ -506,7 +527,10 @@ def simulate_credit_authorization(
506527
"descriptor": descriptor,
507528
"pan": pan,
508529
"mcc": mcc,
530+
"merchant_acceptor_city": merchant_acceptor_city,
531+
"merchant_acceptor_country": merchant_acceptor_country,
509532
"merchant_acceptor_id": merchant_acceptor_id,
533+
"merchant_acceptor_state": merchant_acceptor_state,
510534
},
511535
transaction_simulate_credit_authorization_params.TransactionSimulateCreditAuthorizationParams,
512536
),
@@ -523,7 +547,10 @@ def simulate_credit_authorization_advice(
523547
descriptor: str,
524548
pan: str,
525549
mcc: str | Omit = omit,
550+
merchant_acceptor_city: str | Omit = omit,
551+
merchant_acceptor_country: str | Omit = omit,
526552
merchant_acceptor_id: str | Omit = omit,
553+
merchant_acceptor_state: str | Omit = omit,
527554
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
528555
# The extra values given here take precedence over values defined on the client or passed to this method.
529556
extra_headers: Headers | None = None,
@@ -549,8 +576,14 @@ def simulate_credit_authorization_advice(
549576
listed in ISO 18245. Supported merchant category codes can be found
550577
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
551578
579+
merchant_acceptor_city: Merchant acceptor city
580+
581+
merchant_acceptor_country: Merchant acceptor country code (ISO 3166-1 alpha-3)
582+
552583
merchant_acceptor_id: Unique identifier to identify the payment card acceptor.
553584
585+
merchant_acceptor_state: Merchant acceptor state/province (ISO 3166-2 subdivision code)
586+
554587
extra_headers: Send extra headers
555588
556589
extra_query: Add additional query parameters to the request
@@ -567,7 +600,10 @@ def simulate_credit_authorization_advice(
567600
"descriptor": descriptor,
568601
"pan": pan,
569602
"mcc": mcc,
603+
"merchant_acceptor_city": merchant_acceptor_city,
604+
"merchant_acceptor_country": merchant_acceptor_country,
570605
"merchant_acceptor_id": merchant_acceptor_id,
606+
"merchant_acceptor_state": merchant_acceptor_state,
571607
},
572608
transaction_simulate_credit_authorization_advice_params.TransactionSimulateCreditAuthorizationAdviceParams,
573609
),
@@ -909,7 +945,10 @@ async def simulate_authorization(
909945
descriptor: str,
910946
pan: str,
911947
mcc: str | Omit = omit,
948+
merchant_acceptor_city: str | Omit = omit,
949+
merchant_acceptor_country: str | Omit = omit,
912950
merchant_acceptor_id: str | Omit = omit,
951+
merchant_acceptor_state: str | Omit = omit,
913952
merchant_amount: int | Omit = omit,
914953
merchant_currency: str | Omit = omit,
915954
partial_approval_capable: bool | Omit = omit,
@@ -954,8 +993,14 @@ async def simulate_authorization(
954993
listed in ISO 18245. Supported merchant category codes can be found
955994
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
956995
996+
merchant_acceptor_city: Merchant acceptor city
997+
998+
merchant_acceptor_country: Merchant acceptor country code (ISO 3166-1 alpha-3)
999+
9571000
merchant_acceptor_id: Unique identifier to identify the payment card acceptor.
9581001
1002+
merchant_acceptor_state: Merchant acceptor state/province (ISO 3166-2 subdivision code)
1003+
9591004
merchant_amount: Amount of the transaction to be simulated in currency specified in
9601005
merchant_currency, including any acquirer fees.
9611006
@@ -1001,7 +1046,10 @@ async def simulate_authorization(
10011046
"descriptor": descriptor,
10021047
"pan": pan,
10031048
"mcc": mcc,
1049+
"merchant_acceptor_city": merchant_acceptor_city,
1050+
"merchant_acceptor_country": merchant_acceptor_country,
10041051
"merchant_acceptor_id": merchant_acceptor_id,
1052+
"merchant_acceptor_state": merchant_acceptor_state,
10051053
"merchant_amount": merchant_amount,
10061054
"merchant_currency": merchant_currency,
10071055
"partial_approval_capable": partial_approval_capable,
@@ -1127,7 +1175,10 @@ async def simulate_credit_authorization(
11271175
descriptor: str,
11281176
pan: str,
11291177
mcc: str | Omit = omit,
1178+
merchant_acceptor_city: str | Omit = omit,
1179+
merchant_acceptor_country: str | Omit = omit,
11301180
merchant_acceptor_id: str | Omit = omit,
1181+
merchant_acceptor_state: str | Omit = omit,
11311182
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11321183
# The extra values given here take precedence over values defined on the client or passed to this method.
11331184
extra_headers: Headers | None = None,
@@ -1153,8 +1204,14 @@ async def simulate_credit_authorization(
11531204
listed in ISO 18245. Supported merchant category codes can be found
11541205
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
11551206
1207+
merchant_acceptor_city: Merchant acceptor city
1208+
1209+
merchant_acceptor_country: Merchant acceptor country code (ISO 3166-1 alpha-3)
1210+
11561211
merchant_acceptor_id: Unique identifier to identify the payment card acceptor.
11571212
1213+
merchant_acceptor_state: Merchant acceptor state/province (ISO 3166-2 subdivision code)
1214+
11581215
extra_headers: Send extra headers
11591216
11601217
extra_query: Add additional query parameters to the request
@@ -1171,7 +1228,10 @@ async def simulate_credit_authorization(
11711228
"descriptor": descriptor,
11721229
"pan": pan,
11731230
"mcc": mcc,
1231+
"merchant_acceptor_city": merchant_acceptor_city,
1232+
"merchant_acceptor_country": merchant_acceptor_country,
11741233
"merchant_acceptor_id": merchant_acceptor_id,
1234+
"merchant_acceptor_state": merchant_acceptor_state,
11751235
},
11761236
transaction_simulate_credit_authorization_params.TransactionSimulateCreditAuthorizationParams,
11771237
),
@@ -1188,7 +1248,10 @@ async def simulate_credit_authorization_advice(
11881248
descriptor: str,
11891249
pan: str,
11901250
mcc: str | Omit = omit,
1251+
merchant_acceptor_city: str | Omit = omit,
1252+
merchant_acceptor_country: str | Omit = omit,
11911253
merchant_acceptor_id: str | Omit = omit,
1254+
merchant_acceptor_state: str | Omit = omit,
11921255
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11931256
# The extra values given here take precedence over values defined on the client or passed to this method.
11941257
extra_headers: Headers | None = None,
@@ -1214,8 +1277,14 @@ async def simulate_credit_authorization_advice(
12141277
listed in ISO 18245. Supported merchant category codes can be found
12151278
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
12161279
1280+
merchant_acceptor_city: Merchant acceptor city
1281+
1282+
merchant_acceptor_country: Merchant acceptor country code (ISO 3166-1 alpha-3)
1283+
12171284
merchant_acceptor_id: Unique identifier to identify the payment card acceptor.
12181285
1286+
merchant_acceptor_state: Merchant acceptor state/province (ISO 3166-2 subdivision code)
1287+
12191288
extra_headers: Send extra headers
12201289
12211290
extra_query: Add additional query parameters to the request
@@ -1232,7 +1301,10 @@ async def simulate_credit_authorization_advice(
12321301
"descriptor": descriptor,
12331302
"pan": pan,
12341303
"mcc": mcc,
1304+
"merchant_acceptor_city": merchant_acceptor_city,
1305+
"merchant_acceptor_country": merchant_acceptor_country,
12351306
"merchant_acceptor_id": merchant_acceptor_id,
1307+
"merchant_acceptor_state": merchant_acceptor_state,
12361308
},
12371309
transaction_simulate_credit_authorization_advice_params.TransactionSimulateCreditAuthorizationAdviceParams,
12381310
),

src/lithic/types/transaction_simulate_authorization_params.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,18 @@ class TransactionSimulateAuthorizationParams(TypedDict, total=False):
3131
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
3232
"""
3333

34+
merchant_acceptor_city: str
35+
"""Merchant acceptor city"""
36+
37+
merchant_acceptor_country: str
38+
"""Merchant acceptor country code (ISO 3166-1 alpha-3)"""
39+
3440
merchant_acceptor_id: str
3541
"""Unique identifier to identify the payment card acceptor."""
3642

43+
merchant_acceptor_state: str
44+
"""Merchant acceptor state/province (ISO 3166-2 subdivision code)"""
45+
3746
merchant_amount: int
3847
"""
3948
Amount of the transaction to be simulated in currency specified in

src/lithic/types/transaction_simulate_credit_authorization_advice_params.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,14 @@ class TransactionSimulateCreditAuthorizationAdviceParams(TypedDict, total=False)
3030
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
3131
"""
3232

33+
merchant_acceptor_city: str
34+
"""Merchant acceptor city"""
35+
36+
merchant_acceptor_country: str
37+
"""Merchant acceptor country code (ISO 3166-1 alpha-3)"""
38+
3339
merchant_acceptor_id: str
3440
"""Unique identifier to identify the payment card acceptor."""
41+
42+
merchant_acceptor_state: str
43+
"""Merchant acceptor state/province (ISO 3166-2 subdivision code)"""

src/lithic/types/transaction_simulate_credit_authorization_params.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,14 @@ class TransactionSimulateCreditAuthorizationParams(TypedDict, total=False):
3030
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
3131
"""
3232

33+
merchant_acceptor_city: str
34+
"""Merchant acceptor city"""
35+
36+
merchant_acceptor_country: str
37+
"""Merchant acceptor country code (ISO 3166-1 alpha-3)"""
38+
3339
merchant_acceptor_id: str
3440
"""Unique identifier to identify the payment card acceptor."""
41+
42+
merchant_acceptor_state: str
43+
"""Merchant acceptor state/province (ISO 3166-2 subdivision code)"""

tests/api_resources/test_transactions.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ def test_method_simulate_authorization_with_all_params(self, client: Lithic) ->
163163
descriptor="COFFEE SHOP",
164164
pan="4111111289144142",
165165
mcc="5812",
166+
merchant_acceptor_city="LOS ANGELES",
167+
merchant_acceptor_country="USA",
166168
merchant_acceptor_id="OODKZAPJVN4YS7O",
169+
merchant_acceptor_state="CA",
167170
merchant_amount=0,
168171
merchant_currency="GBP",
169172
partial_approval_capable=True,
@@ -292,7 +295,10 @@ def test_method_simulate_credit_authorization_with_all_params(self, client: Lith
292295
descriptor="COFFEE SHOP",
293296
pan="4111111289144142",
294297
mcc="5812",
298+
merchant_acceptor_city="SEATTLE",
299+
merchant_acceptor_country="USA",
295300
merchant_acceptor_id="XRKGDPOWEWQRRWU",
301+
merchant_acceptor_state="WA",
296302
)
297303

298304
assert_matches_type(TransactionSimulateCreditAuthorizationResponse, transaction, path=["response"])
@@ -343,7 +349,10 @@ def test_method_simulate_credit_authorization_advice_with_all_params(self, clien
343349
descriptor="COFFEE SHOP",
344350
pan="4111111289144142",
345351
mcc="5812",
352+
merchant_acceptor_city="SEATTLE",
353+
merchant_acceptor_country="USA",
346354
merchant_acceptor_id="XRKGDPOWEWQRRWU",
355+
merchant_acceptor_state="WA",
347356
)
348357
assert_matches_type(TransactionSimulateCreditAuthorizationAdviceResponse, transaction, path=["response"])
349358

@@ -621,7 +630,10 @@ async def test_method_simulate_authorization_with_all_params(self, async_client:
621630
descriptor="COFFEE SHOP",
622631
pan="4111111289144142",
623632
mcc="5812",
633+
merchant_acceptor_city="LOS ANGELES",
634+
merchant_acceptor_country="USA",
624635
merchant_acceptor_id="OODKZAPJVN4YS7O",
636+
merchant_acceptor_state="CA",
625637
merchant_amount=0,
626638
merchant_currency="GBP",
627639
partial_approval_capable=True,
@@ -750,7 +762,10 @@ async def test_method_simulate_credit_authorization_with_all_params(self, async_
750762
descriptor="COFFEE SHOP",
751763
pan="4111111289144142",
752764
mcc="5812",
765+
merchant_acceptor_city="SEATTLE",
766+
merchant_acceptor_country="USA",
753767
merchant_acceptor_id="XRKGDPOWEWQRRWU",
768+
merchant_acceptor_state="WA",
754769
)
755770

756771
assert_matches_type(TransactionSimulateCreditAuthorizationResponse, transaction, path=["response"])
@@ -801,7 +816,10 @@ async def test_method_simulate_credit_authorization_advice_with_all_params(self,
801816
descriptor="COFFEE SHOP",
802817
pan="4111111289144142",
803818
mcc="5812",
819+
merchant_acceptor_city="SEATTLE",
820+
merchant_acceptor_country="USA",
804821
merchant_acceptor_id="XRKGDPOWEWQRRWU",
822+
merchant_acceptor_state="WA",
805823
)
806824
assert_matches_type(TransactionSimulateCreditAuthorizationAdviceResponse, transaction, path=["response"])
807825

0 commit comments

Comments
 (0)