Skip to content

Commit 22955ed

Browse files
feat(api): Add amounts object to ASA request
1 parent 6ddef73 commit 22955ed

4 files changed

Lines changed: 613 additions & 63 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: 177
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

lib/lithic/models/card_authorization_approval_request_webhook_event.rb

Lines changed: 178 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,31 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
1818
required :acquirer_fee, Integer
1919

2020
# @!attribute amount
21-
# Authorization amount of the transaction (in cents), including any acquirer fees.
22-
# The contents of this field are identical to `authorization_amount`.
21+
# @deprecated
22+
#
23+
# Deprecated, use `amounts`. Authorization amount of the transaction (in cents),
24+
# including any acquirer fees. The contents of this field are identical to
25+
# `authorization_amount`.
2326
#
2427
# @return [Integer]
2528
required :amount, Integer
2629

30+
# @!attribute amounts
31+
# Structured amounts for this authorization. The `cardholder` and `merchant`
32+
# amounts reflect the original network authorization values. For programs with
33+
# hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the
34+
# `hold` amount may exceed the `cardholder` and `merchant` amounts to account for
35+
# anticipated final transaction amounts such as tips or fuel fill-ups
36+
#
37+
# @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts]
38+
required :amounts, -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Amounts }
39+
2740
# @!attribute authorization_amount
28-
# The base transaction amount (in cents) plus the acquirer fee field. This is the
29-
# amount the issuer should authorize against unless the issuer is paying the
30-
# acquirer fee on behalf of the cardholder.
41+
# @deprecated
42+
#
43+
# Deprecated, use `amounts`. The base transaction amount (in cents) plus the
44+
# acquirer fee field. This is the amount the issuer should authorize against
45+
# unless the issuer is paying the acquirer fee on behalf of the cardholder.
3146
#
3247
# @return [Integer]
3348
required :authorization_amount, Integer
@@ -44,7 +59,10 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
4459
required :card, -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Card }
4560

4661
# @!attribute cardholder_currency
47-
# 3-character alphabetic ISO 4217 code for cardholder's billing currency.
62+
# @deprecated
63+
#
64+
# Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for cardholder's
65+
# billing currency.
4866
#
4967
# @return [String]
5068
required :cardholder_currency, String
@@ -77,24 +95,30 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
7795
required :merchant, -> { Lithic::Merchant }
7896

7997
# @!attribute merchant_amount
80-
# The amount that the merchant will receive, denominated in `merchant_currency`
81-
# and in the smallest currency unit. Note the amount includes `acquirer_fee`,
82-
# similar to `authorization_amount`. It will be different from
83-
# `authorization_amount` if the merchant is taking payment in a different
84-
# currency.
98+
# @deprecated
99+
#
100+
# Deprecated, use `amounts`. The amount that the merchant will receive,
101+
# denominated in `merchant_currency` and in the smallest currency unit. Note the
102+
# amount includes `acquirer_fee`, similar to `authorization_amount`. It will be
103+
# different from `authorization_amount` if the merchant is taking payment in a
104+
# different currency.
85105
#
86106
# @return [Integer]
87107
required :merchant_amount, Integer
88108

89109
# @!attribute merchant_currency
110+
# @deprecated
111+
#
90112
# 3-character alphabetic ISO 4217 code for the local currency of the transaction.
91113
#
92114
# @return [String]
93115
required :merchant_currency, String
94116

95117
# @!attribute settled_amount
96-
# Amount (in cents) of the transaction that has been settled, including any
97-
# acquirer fees
118+
# @deprecated
119+
#
120+
# Deprecated, use `amounts`. Amount (in cents) of the transaction that has been
121+
# settled, including any acquirer fees.
98122
#
99123
# @return [Integer]
100124
required :settled_amount, Integer
@@ -131,11 +155,13 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
131155
optional :cashback, Integer
132156

133157
# @!attribute conversion_rate
134-
# If the transaction was requested in a currency other than the settlement
135-
# currency, this field will be populated to indicate the rate used to translate
136-
# the merchant_amount to the amount (i.e., `merchant_amount` x `conversion_rate` =
137-
# `amount`). Note that the `merchant_amount` is in the local currency and the
138-
# amount is in the settlement currency.
158+
# @deprecated
159+
#
160+
# Deprecated, use `amounts`. If the transaction was requested in a currency other
161+
# than the settlement currency, this field will be populated to indicate the rate
162+
# used to translate the merchant_amount to the amount (i.e., `merchant_amount` x
163+
# `conversion_rate` = `amount`). Note that the `merchant_amount` is in the local
164+
# currency and the amount is in the settlement currency.
139165
#
140166
# @return [Float, nil]
141167
optional :conversion_rate, Float
@@ -206,35 +232,37 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
206232
# @return [Time, nil]
207233
optional :ttl, Time
208234

209-
# @!method initialize(token:, acquirer_fee:, amount:, authorization_amount:, avs:, card:, cardholder_currency:, cash_amount:, created:, merchant:, merchant_amount:, merchant_currency:, settled_amount:, status:, transaction_initiator:, account_type: nil, cardholder_authentication: nil, cashback: nil, conversion_rate: nil, event_token: nil, fleet_info: nil, latest_challenge: nil, network: nil, network_risk_score: nil, network_specific_data: nil, pos: nil, token_info: nil, ttl: nil, event_type: :"card_authorization.approval_request")
235+
# @!method initialize(token:, acquirer_fee:, amount:, amounts:, authorization_amount:, avs:, card:, cardholder_currency:, cash_amount:, created:, merchant:, merchant_amount:, merchant_currency:, settled_amount:, status:, transaction_initiator:, account_type: nil, cardholder_authentication: nil, cashback: nil, conversion_rate: nil, event_token: nil, fleet_info: nil, latest_challenge: nil, network: nil, network_risk_score: nil, network_specific_data: nil, pos: nil, token_info: nil, ttl: nil, event_type: :"card_authorization.approval_request")
210236
# Some parameter documentations has been truncated, see
211237
# {Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent} for more details.
212238
#
213239
# @param token [String] The provisional transaction group uuid associated with the authorization
214240
#
215241
# @param acquirer_fee [Integer] Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be
216242
#
217-
# @param amount [Integer] Authorization amount of the transaction (in cents), including any acquirer fees.
243+
# @param amount [Integer] Deprecated, use `amounts`. Authorization amount of the transaction (in cents), i
244+
#
245+
# @param amounts [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts] Structured amounts for this authorization. The `cardholder` and `merchant` amoun
218246
#
219-
# @param authorization_amount [Integer] The base transaction amount (in cents) plus the acquirer fee field. This is the
247+
# @param authorization_amount [Integer] Deprecated, use `amounts`. The base transaction amount (in cents) plus the acqui
220248
#
221249
# @param avs [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Avs]
222250
#
223251
# @param card [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Card] Card object in ASA
224252
#
225-
# @param cardholder_currency [String] 3-character alphabetic ISO 4217 code for cardholder's billing currency.
253+
# @param cardholder_currency [String] Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for cardholder's
226254
#
227255
# @param cash_amount [Integer] The portion of the transaction requested as cash back by the cardholder, and doe
228256
#
229257
# @param created [Time] Date and time when the transaction first occurred in UTC.
230258
#
231259
# @param merchant [Lithic::Models::Merchant]
232260
#
233-
# @param merchant_amount [Integer] The amount that the merchant will receive, denominated in `merchant_currency` an
261+
# @param merchant_amount [Integer] Deprecated, use `amounts`. The amount that the merchant will receive, denominate
234262
#
235263
# @param merchant_currency [String] 3-character alphabetic ISO 4217 code for the local currency of the transaction.
236264
#
237-
# @param settled_amount [Integer] Amount (in cents) of the transaction that has been settled, including any acquir
265+
# @param settled_amount [Integer] Deprecated, use `amounts`. Amount (in cents) of the transaction that has been se
238266
#
239267
# @param status [Symbol, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Status] The type of authorization request that this request is for. Note that `CREDIT_AU
240268
#
@@ -246,7 +274,7 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
246274
#
247275
# @param cashback [Integer] Deprecated, use `cash_amount`.
248276
#
249-
# @param conversion_rate [Float] If the transaction was requested in a currency other than the settlement currenc
277+
# @param conversion_rate [Float] Deprecated, use `amounts`. If the transaction was requested in a currency other
250278
#
251279
# @param event_token [String] The event token associated with the authorization. This field is only set for pr
252280
#
@@ -268,6 +296,131 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
268296
#
269297
# @param event_type [Symbol, :"card_authorization.approval_request"]
270298

299+
# @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent#amounts
300+
class Amounts < Lithic::Internal::Type::BaseModel
301+
# @!attribute cardholder
302+
#
303+
# @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Cardholder]
304+
required :cardholder, -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Cardholder }
305+
306+
# @!attribute hold
307+
#
308+
# @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Hold, nil]
309+
required :hold, -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Hold }, nil?: true
310+
311+
# @!attribute merchant
312+
#
313+
# @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Merchant]
314+
required :merchant, -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Merchant }
315+
316+
# @!attribute settlement
317+
#
318+
# @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Settlement, nil]
319+
required :settlement,
320+
-> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Settlement },
321+
nil?: true
322+
323+
# @!method initialize(cardholder:, hold:, merchant:, settlement:)
324+
# Structured amounts for this authorization. The `cardholder` and `merchant`
325+
# amounts reflect the original network authorization values. For programs with
326+
# hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the
327+
# `hold` amount may exceed the `cardholder` and `merchant` amounts to account for
328+
# anticipated final transaction amounts such as tips or fuel fill-ups
329+
#
330+
# @param cardholder [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Cardholder]
331+
# @param hold [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Hold, nil]
332+
# @param merchant [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Merchant]
333+
# @param settlement [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts::Settlement, nil]
334+
335+
# @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts#cardholder
336+
class Cardholder < Lithic::Internal::Type::BaseModel
337+
# @!attribute amount
338+
# Amount in the smallest unit of the applicable currency (e.g., cents)
339+
#
340+
# @return [Integer]
341+
required :amount, Integer
342+
343+
# @!attribute conversion_rate
344+
# Exchange rate used for currency conversion
345+
#
346+
# @return [String]
347+
required :conversion_rate, String
348+
349+
# @!attribute currency
350+
# 3-character alphabetic ISO 4217 currency
351+
#
352+
# @return [String]
353+
required :currency, String
354+
355+
# @!method initialize(amount:, conversion_rate:, currency:)
356+
# @param amount [Integer] Amount in the smallest unit of the applicable currency (e.g., cents)
357+
#
358+
# @param conversion_rate [String] Exchange rate used for currency conversion
359+
#
360+
# @param currency [String] 3-character alphabetic ISO 4217 currency
361+
end
362+
363+
# @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts#hold
364+
class Hold < Lithic::Internal::Type::BaseModel
365+
# @!attribute amount
366+
# Amount in the smallest unit of the applicable currency (e.g., cents)
367+
#
368+
# @return [Integer]
369+
required :amount, Integer
370+
371+
# @!attribute currency
372+
# 3-character alphabetic ISO 4217 currency
373+
#
374+
# @return [String]
375+
required :currency, String
376+
377+
# @!method initialize(amount:, currency:)
378+
# @param amount [Integer] Amount in the smallest unit of the applicable currency (e.g., cents)
379+
#
380+
# @param currency [String] 3-character alphabetic ISO 4217 currency
381+
end
382+
383+
# @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts#merchant
384+
class Merchant < Lithic::Internal::Type::BaseModel
385+
# @!attribute amount
386+
# Amount in the smallest unit of the applicable currency (e.g., cents)
387+
#
388+
# @return [Integer]
389+
required :amount, Integer
390+
391+
# @!attribute currency
392+
# 3-character alphabetic ISO 4217 currency
393+
#
394+
# @return [String]
395+
required :currency, String
396+
397+
# @!method initialize(amount:, currency:)
398+
# @param amount [Integer] Amount in the smallest unit of the applicable currency (e.g., cents)
399+
#
400+
# @param currency [String] 3-character alphabetic ISO 4217 currency
401+
end
402+
403+
# @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Amounts#settlement
404+
class Settlement < Lithic::Internal::Type::BaseModel
405+
# @!attribute amount
406+
# Amount in the smallest unit of the applicable currency (e.g., cents)
407+
#
408+
# @return [Integer]
409+
required :amount, Integer
410+
411+
# @!attribute currency
412+
# 3-character alphabetic ISO 4217 currency
413+
#
414+
# @return [String]
415+
required :currency, String
416+
417+
# @!method initialize(amount:, currency:)
418+
# @param amount [Integer] Amount in the smallest unit of the applicable currency (e.g., cents)
419+
#
420+
# @param currency [String] 3-character alphabetic ISO 4217 currency
421+
end
422+
end
423+
271424
# @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent#avs
272425
class Avs < Lithic::Internal::Type::BaseModel
273426
# @!attribute address

0 commit comments

Comments
 (0)