Skip to content

Commit 8def5f2

Browse files
feat(api): Add amounts object to ASA request
1 parent 4240097 commit 8def5f2

2 files changed

Lines changed: 85 additions & 11 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: 176
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-8382e530e5b258ec35781d1e167a9a0159bdade6a8fc28e309bdb3eadc0dcdef.yml
3-
openapi_spec_hash: 6489eed734e9c836b16d0c5b4bbce4e4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c24eebe942f400bff8922a6fbef1ce551ad14f61eb4da21b50d823a62ca42586.yml
3+
openapi_spec_hash: b79ed927e625dedff69cea29131a34d9
44
config_hash: 693dddc4721eef512d75ab6c60897794

src/lithic/types/card_authorization_approval_request_webhook_event.py

Lines changed: 83 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66

77
from .._models import BaseModel
88
from .token_info import TokenInfo
9+
from .shared.currency import Currency
910
from .shared.merchant import Merchant
1011
from .cardholder_authentication import CardholderAuthentication
1112

1213
__all__ = [
1314
"CardAuthorizationApprovalRequestWebhookEvent",
15+
"Amounts",
16+
"AmountsCardholder",
17+
"AmountsHold",
18+
"AmountsMerchant",
19+
"AmountsSettlement",
1420
"Avs",
1521
"Card",
1622
"FleetInfo",
@@ -25,6 +31,56 @@
2531
]
2632

2733

34+
class AmountsCardholder(BaseModel):
35+
amount: int
36+
"""Amount in the smallest unit of the applicable currency (e.g., cents)"""
37+
38+
conversion_rate: str
39+
"""Exchange rate used for currency conversion"""
40+
41+
currency: Currency
42+
"""3-character alphabetic ISO 4217 currency"""
43+
44+
45+
class AmountsHold(BaseModel):
46+
amount: int
47+
"""Amount in the smallest unit of the applicable currency (e.g., cents)"""
48+
49+
currency: Currency
50+
"""3-character alphabetic ISO 4217 currency"""
51+
52+
53+
class AmountsMerchant(BaseModel):
54+
amount: int
55+
"""Amount in the smallest unit of the applicable currency (e.g., cents)"""
56+
57+
currency: Currency
58+
"""3-character alphabetic ISO 4217 currency"""
59+
60+
61+
class AmountsSettlement(BaseModel):
62+
amount: int
63+
"""Amount in the smallest unit of the applicable currency (e.g., cents)"""
64+
65+
currency: Currency
66+
"""3-character alphabetic ISO 4217 currency"""
67+
68+
69+
class Amounts(BaseModel):
70+
"""Structured amounts for this authorization.
71+
72+
The `cardholder` and `merchant` amounts reflect the original network authorization values. For programs with hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the `hold` amount may exceed the `cardholder` and `merchant` amounts to account for anticipated final transaction amounts such as tips or fuel fill-ups
73+
"""
74+
75+
cardholder: AmountsCardholder
76+
77+
hold: Optional[AmountsHold] = None
78+
79+
merchant: AmountsMerchant
80+
81+
settlement: Optional[AmountsSettlement] = None
82+
83+
2884
class Avs(BaseModel):
2985
address: str
3086
"""Cardholder address"""
@@ -305,16 +361,28 @@ class CardAuthorizationApprovalRequestWebhookEvent(BaseModel):
305361
"""
306362

307363
amount: int
308-
"""Authorization amount of the transaction (in cents), including any acquirer fees.
364+
"""Deprecated, use `amounts`.
309365
366+
Authorization amount of the transaction (in cents), including any acquirer fees.
310367
The contents of this field are identical to `authorization_amount`.
311368
"""
312369

370+
amounts: Amounts
371+
"""Structured amounts for this authorization.
372+
373+
The `cardholder` and `merchant` amounts reflect the original network
374+
authorization values. For programs with hold adjustments enabled (e.g.,
375+
automated fuel dispensers or tipping MCCs), the `hold` amount may exceed the
376+
`cardholder` and `merchant` amounts to account for anticipated final transaction
377+
amounts such as tips or fuel fill-ups
378+
"""
379+
313380
authorization_amount: int
314-
"""The base transaction amount (in cents) plus the acquirer fee field.
381+
"""Deprecated, use `amounts`.
315382
316-
This is the amount the issuer should authorize against unless the issuer is
317-
paying the acquirer fee on behalf of the cardholder.
383+
The base transaction amount (in cents) plus the acquirer fee field. This is the
384+
amount the issuer should authorize against unless the issuer is paying the
385+
acquirer fee on behalf of the cardholder.
318386
"""
319387

320388
avs: Avs
@@ -323,7 +391,10 @@ class CardAuthorizationApprovalRequestWebhookEvent(BaseModel):
323391
"""Card object in ASA"""
324392

325393
cardholder_currency: str
326-
"""3-character alphabetic ISO 4217 code for cardholder's billing currency."""
394+
"""Deprecated, use `amounts`.
395+
396+
3-character alphabetic ISO 4217 code for cardholder's billing currency.
397+
"""
327398

328399
cash_amount: int
329400
"""
@@ -343,7 +414,8 @@ class CardAuthorizationApprovalRequestWebhookEvent(BaseModel):
343414
merchant: Merchant
344415

345416
merchant_amount: int
346-
"""
417+
"""Deprecated, use `amounts`.
418+
347419
The amount that the merchant will receive, denominated in `merchant_currency`
348420
and in the smallest currency unit. Note the amount includes `acquirer_fee`,
349421
similar to `authorization_amount`. It will be different from
@@ -355,9 +427,10 @@ class CardAuthorizationApprovalRequestWebhookEvent(BaseModel):
355427
"""3-character alphabetic ISO 4217 code for the local currency of the transaction."""
356428

357429
settled_amount: int
358-
"""
430+
"""Deprecated, use `amounts`.
431+
359432
Amount (in cents) of the transaction that has been settled, including any
360-
acquirer fees
433+
acquirer fees.
361434
"""
362435

363436
status: Literal[
@@ -384,7 +457,8 @@ class CardAuthorizationApprovalRequestWebhookEvent(BaseModel):
384457
"""Deprecated, use `cash_amount`."""
385458

386459
conversion_rate: Optional[float] = None
387-
"""
460+
"""Deprecated, use `amounts`.
461+
388462
If the transaction was requested in a currency other than the settlement
389463
currency, this field will be populated to indicate the rate used to translate
390464
the merchant_amount to the amount (i.e., `merchant_amount` x `conversion_rate` =

0 commit comments

Comments
 (0)