Skip to content

Commit edf8fbc

Browse files
feat(api): Add tags field to card transactions
1 parent 80369fe commit edf8fbc

5 files changed

Lines changed: 29 additions & 3 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-11ebfaf7523a8c0eafca9e2c914e44102537634be4b22289fe85d46b9ab3d650.yml
3-
openapi_spec_hash: 38fdabb7812d528c839eadad87d49e5a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1307147a7305d37c3eb288d87350e35d946c27e6b40dc8c6a00967d806dbade5.yml
3+
openapi_spec_hash: 21c48156c56569871d503df54e2e1442
44
config_hash: 31d71922d7838f34ae0875c9b8026d99

lib/lithic/models/transaction.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ class Transaction < Lithic::Internal::Type::BaseModel
162162
# @return [Symbol, Lithic::Models::Transaction::Status]
163163
required :status, enum: -> { Lithic::Transaction::Status }
164164

165+
# @!attribute tags
166+
# Key-value pairs for tagging resources. Tags allow you to associate arbitrary
167+
# metadata with a resource for your own purposes.
168+
#
169+
# @return [Hash{Symbol=>String}]
170+
required :tags, Lithic::Internal::Type::HashOf[String]
171+
165172
# @!attribute token_info
166173
#
167174
# @return [Lithic::Models::TokenInfo, nil]
@@ -178,7 +185,7 @@ class Transaction < Lithic::Internal::Type::BaseModel
178185
# @return [Array<Lithic::Models::Transaction::Event>, nil]
179186
optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event] }
180187

181-
# @!method initialize(token:, account_token:, acquirer_fee:, acquirer_reference_number:, amount:, amounts:, authorization_amount:, authorization_code:, avs:, card_token:, cardholder_authentication:, created:, financial_account_token:, merchant:, merchant_amount:, merchant_authorization_amount:, merchant_currency:, network:, network_risk_score:, pos:, result:, settled_amount:, status:, token_info:, updated:, events: nil)
188+
# @!method initialize(token:, account_token:, acquirer_fee:, acquirer_reference_number:, amount:, amounts:, authorization_amount:, authorization_code:, avs:, card_token:, cardholder_authentication:, created:, financial_account_token:, merchant:, merchant_amount:, merchant_authorization_amount:, merchant_currency:, network:, network_risk_score:, pos:, result:, settled_amount:, status:, tags:, token_info:, updated:, events: nil)
182189
# Some parameter documentations has been truncated, see
183190
# {Lithic::Models::Transaction} for more details.
184191
#
@@ -228,6 +235,8 @@ class Transaction < Lithic::Internal::Type::BaseModel
228235
#
229236
# @param status [Symbol, Lithic::Models::Transaction::Status] Status of the transaction.
230237
#
238+
# @param tags [Hash{Symbol=>String}] Key-value pairs for tagging resources. Tags allow you to associate arbitrary met
239+
#
231240
# @param token_info [Lithic::Models::TokenInfo, nil]
232241
#
233242
# @param updated [Time] Date and time when the transaction last updated. UTC time zone.

rbi/lithic/models/transaction.rbi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ module Lithic
124124
sig { returns(Lithic::Transaction::Status::TaggedSymbol) }
125125
attr_accessor :status
126126

127+
# Key-value pairs for tagging resources. Tags allow you to associate arbitrary
128+
# metadata with a resource for your own purposes.
129+
sig { returns(T::Hash[Symbol, String]) }
130+
attr_accessor :tags
131+
127132
sig { returns(T.nilable(Lithic::TokenInfo)) }
128133
attr_reader :token_info
129134

@@ -166,6 +171,7 @@ module Lithic
166171
result: Lithic::Transaction::Result::OrSymbol,
167172
settled_amount: Integer,
168173
status: Lithic::Transaction::Status::OrSymbol,
174+
tags: T::Hash[Symbol, String],
169175
token_info: T.nilable(Lithic::TokenInfo::OrHash),
170176
updated: Time,
171177
events: T::Array[Lithic::Transaction::Event::OrHash]
@@ -224,6 +230,9 @@ module Lithic
224230
settled_amount:,
225231
# Status of the transaction.
226232
status:,
233+
# Key-value pairs for tagging resources. Tags allow you to associate arbitrary
234+
# metadata with a resource for your own purposes.
235+
tags:,
227236
token_info:,
228237
# Date and time when the transaction last updated. UTC time zone.
229238
updated:,
@@ -258,6 +267,7 @@ module Lithic
258267
result: Lithic::Transaction::Result::TaggedSymbol,
259268
settled_amount: Integer,
260269
status: Lithic::Transaction::Status::TaggedSymbol,
270+
tags: T::Hash[Symbol, String],
261271
token_info: T.nilable(Lithic::TokenInfo),
262272
updated: Time,
263273
events: T::Array[Lithic::Transaction::Event]

sig/lithic/models/transaction.rbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module Lithic
2525
result: Lithic::Models::Transaction::result,
2626
settled_amount: Integer,
2727
status: Lithic::Models::Transaction::status,
28+
tags: ::Hash[Symbol, String],
2829
token_info: Lithic::TokenInfo?,
2930
updated: Time,
3031
events: ::Array[Lithic::Transaction::Event]
@@ -77,6 +78,8 @@ module Lithic
7778

7879
attr_accessor status: Lithic::Models::Transaction::status
7980

81+
attr_accessor tags: ::Hash[Symbol, String]
82+
8083
attr_accessor token_info: Lithic::TokenInfo?
8184

8285
attr_accessor updated: Time
@@ -111,6 +114,7 @@ module Lithic
111114
result: Lithic::Models::Transaction::result,
112115
settled_amount: Integer,
113116
status: Lithic::Models::Transaction::status,
117+
tags: ::Hash[Symbol, String],
114118
token_info: Lithic::TokenInfo?,
115119
updated: Time,
116120
?events: ::Array[Lithic::Transaction::Event]
@@ -140,6 +144,7 @@ module Lithic
140144
result: Lithic::Models::Transaction::result,
141145
settled_amount: Integer,
142146
status: Lithic::Models::Transaction::status,
147+
tags: ::Hash[Symbol, String],
143148
token_info: Lithic::TokenInfo?,
144149
updated: Time,
145150
events: ::Array[Lithic::Transaction::Event]

test/lithic/resources/transactions_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_retrieve
3535
result: Lithic::Transaction::Result,
3636
settled_amount: Integer,
3737
status: Lithic::Transaction::Status,
38+
tags: ^(Lithic::Internal::Type::HashOf[String]),
3839
token_info: Lithic::TokenInfo | nil,
3940
updated: Time,
4041
events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event]) | nil
@@ -81,6 +82,7 @@ def test_list
8182
result: Lithic::Transaction::Result,
8283
settled_amount: Integer,
8384
status: Lithic::Transaction::Status,
85+
tags: ^(Lithic::Internal::Type::HashOf[String]),
8486
token_info: Lithic::TokenInfo | nil,
8587
updated: Time,
8688
events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event]) | nil

0 commit comments

Comments
 (0)