flowcommerce 0.2.30 → 0.2.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea4a69a3710ccfbae5be05efd61d3d99acb6a2b4
4
- data.tar.gz: 5a405b5638523aa6740523b23ff5bffc8cfcafda
3
+ metadata.gz: ff74a44e5a83c8569e1b7e57a4d2da1b9abbdc5f
4
+ data.tar.gz: d93661d25ebc74e79249a4439a77b5acd85181d5
5
5
  SHA512:
6
- metadata.gz: d9340c262999020a9cbdec8ceaa031791b74c23bb774008af30ae55404a7991acb6ec6c3e05403291cccca3b94e4797903f4de62c357882581b0d8c46940f8ac
7
- data.tar.gz: 149ab9417e58527bea4dbbd37e131c112225a579e092379448579241af6b145981892ccbaddfed6c610fe5839ceddd54ac3fcc4f65ebade43db185ab2a4c4b42
6
+ metadata.gz: b71bffbd461907cde5e0300a6fdc35d530c061c176bc2c595ff17a67bad8980a06ce40bff62108247ac11364216a7c859da1718bcbcbc655272d4ab921a63d9f
7
+ data.tar.gz: 4bfb0ef5dc148e616ab6023bd3282ad48dec60eb097b58f582f0f678c893af0d2f9eb88bbf411f3e04b70a47e7b61fd053668ace41b2ce2ee300f0a4ef9428cb
@@ -1,6 +1,6 @@
1
1
  # Generated by API Builder - https://www.apibuilder.io
2
2
  # Service version: 0.3.65
3
- # apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.73/ruby_client
3
+ # apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.77/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,7 +25,7 @@ module Io
25
25
 
26
26
  BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
27
27
  NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
28
- USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.73/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.77/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.3.65' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -108,6 +108,10 @@ module Io
108
108
  @organizations ||= ::Io::Flow::V0::Clients::Organizations.new(self)
109
109
  end
110
110
 
111
+ def payment_method_rules
112
+ @payment_method_rules ||= ::Io::Flow::V0::Clients::PaymentMethodRules.new(self)
113
+ end
114
+
111
115
  def queries
112
116
  @queries ||= ::Io::Flow::V0::Clients::Queries.new(self)
113
117
  end
@@ -200,6 +204,10 @@ module Io
200
204
  @refunds ||= ::Io::Flow::V0::Clients::Refunds.new(self)
201
205
  end
202
206
 
207
+ def reversals
208
+ @reversals ||= ::Io::Flow::V0::Clients::Reversals.new(self)
209
+ end
210
+
203
211
  def centers
204
212
  @centers ||= ::Io::Flow::V0::Clients::Centers.new(self)
205
213
  end
@@ -1350,6 +1358,28 @@ module Io
1350
1358
 
1351
1359
  end
1352
1360
 
1361
+ class PaymentMethodRules
1362
+
1363
+ def initialize(client)
1364
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
1365
+ end
1366
+
1367
+ def get(organization, incoming={})
1368
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1369
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1370
+ query = {
1371
+ :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)),
1372
+ :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),
1373
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1374
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1375
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "display_position" : x), String)
1376
+ }.delete_if { |k, v| v.nil? }
1377
+ r = @client.request("/#{CGI.escape(organization)}/payment-method-rules").with_query(query).get
1378
+ r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) }
1379
+ end
1380
+
1381
+ end
1382
+
1353
1383
  class Queries
1354
1384
 
1355
1385
  def initialize(client)
@@ -2338,8 +2368,8 @@ module Io
2338
2368
  ::Io::Flow::V0::Models::Authorization.from_json(r)
2339
2369
  end
2340
2370
 
2341
- # Deletes a given authorization. This method will return a 422 if funds have
2342
- # already been captured.
2371
+ # Deprecated. This end point no longer deletes an authorization and is
2372
+ # implemented by creating a reversal for the remaining balance on the auth.
2343
2373
  def delete_by_key(organization, key)
2344
2374
  HttpClient::Preconditions.assert_class('organization', organization, String)
2345
2375
  HttpClient::Preconditions.assert_class('key', key, String)
@@ -2648,6 +2678,68 @@ module Io
2648
2678
 
2649
2679
  end
2650
2680
 
2681
+ class Reversals
2682
+
2683
+ def initialize(client)
2684
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2685
+ end
2686
+
2687
+ def get(organization, incoming={})
2688
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2689
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2690
+ query = {
2691
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2692
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
2693
+ :authorization_id => (x = opts.delete(:authorization_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_id', x, String)),
2694
+ :authorization_key => (x = opts.delete(:authorization_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_key', x, String)),
2695
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2696
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2697
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2698
+ }.delete_if { |k, v| v.nil? }
2699
+ r = @client.request("/#{CGI.escape(organization)}/reversals").with_query(query).get
2700
+ r.map { |x| ::Io::Flow::V0::Models::Reversal.new(x) }
2701
+ end
2702
+
2703
+ def post(organization, reversal_form)
2704
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2705
+ (x = reversal_form; x.is_a?(::Io::Flow::V0::Models::ReversalForm) ? x : ::Io::Flow::V0::Models::ReversalForm.new(x))
2706
+ r = @client.request("/#{CGI.escape(organization)}/reversals").with_json(reversal_form.to_json).post
2707
+ ::Io::Flow::V0::Models::Reversal.new(r)
2708
+ end
2709
+
2710
+ def get_by_key(organization, key)
2711
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2712
+ HttpClient::Preconditions.assert_class('key', key, String)
2713
+ r = @client.request("/#{CGI.escape(organization)}/reversals/#{CGI.escape(key)}").get
2714
+ ::Io::Flow::V0::Models::Reversal.new(r)
2715
+ end
2716
+
2717
+ # Try inserting or updating a new reversal. Useful for retrying pending
2718
+ # reversals
2719
+ def put_by_key(organization, key, reversal_put_form)
2720
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2721
+ HttpClient::Preconditions.assert_class('key', key, String)
2722
+ (x = reversal_put_form; x.is_a?(::Io::Flow::V0::Models::ReversalPutForm) ? x : ::Io::Flow::V0::Models::ReversalPutForm.new(x))
2723
+ r = @client.request("/#{CGI.escape(organization)}/reversals/#{CGI.escape(key)}").with_json(reversal_put_form.to_json).put
2724
+ ::Io::Flow::V0::Models::Reversal.new(r)
2725
+ end
2726
+
2727
+ def get_versions(organization, incoming={})
2728
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2729
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2730
+ query = {
2731
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, Integer) }),
2732
+ :reversal_id => (x = opts.delete(:reversal_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('reversal_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('reversal_id', v, String) }),
2733
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2734
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2735
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2736
+ }.delete_if { |k, v| v.nil? }
2737
+ r = @client.request("/#{CGI.escape(organization)}/reversals/versions").with_query(query).get
2738
+ r.map { |x| ::Io::Flow::V0::Models::ReversalVersion.new(x) }
2739
+ end
2740
+
2741
+ end
2742
+
2651
2743
  class Centers
2652
2744
 
2653
2745
  def initialize(client)
@@ -4878,6 +4970,8 @@ module Io
4878
4970
  class AuthorizationForm
4879
4971
 
4880
4972
  module Types
4973
+ # Creates a new authorization by copying an existing on
4974
+ AUTHORIZATION_COPY_FORM = 'authorization_copy_form' unless defined?(AUTHORIZATION_COPY_FORM)
4881
4975
  # Enables card payments
4882
4976
  DIRECT_AUTHORIZATION_FORM = 'direct_authorization_form' unless defined?(DIRECT_AUTHORIZATION_FORM)
4883
4977
  # Enables card payments with Flow as Merchant of Record
@@ -4886,6 +4980,9 @@ module Io
4886
4980
  PAYPAL_AUTHORIZATION_FORM = 'paypal_authorization_form' unless defined?(PAYPAL_AUTHORIZATION_FORM)
4887
4981
  # Enables authorizations via UnionPay
4888
4982
  UNIONPAY_AUTHORIZATION_FORM = 'unionpay_authorization_form' unless defined?(UNIONPAY_AUTHORIZATION_FORM)
4983
+ # Enables authorizations via redirect-based alternative payment methods, such as
4984
+ # AliPay.
4985
+ REDIRECT_AUTHORIZATION_FORM = 'redirect_authorization_form' unless defined?(REDIRECT_AUTHORIZATION_FORM)
4889
4986
  end
4890
4987
 
4891
4988
  attr_reader :discriminator
@@ -4897,7 +4994,7 @@ module Io
4897
4994
  end
4898
4995
 
4899
4996
  def subtype_to_hash
4900
- raise 'Cannot serialize an instance of authorization_form directly - must use one of the specific types: direct_authorization_form, merchant_of_record_authorization_form, paypal_authorization_form, unionpay_authorization_form'
4997
+ raise 'Cannot serialize an instance of authorization_form directly - must use one of the specific types: authorization_copy_form, direct_authorization_form, merchant_of_record_authorization_form, paypal_authorization_form, unionpay_authorization_form, redirect_authorization_form'
4901
4998
  end
4902
4999
 
4903
5000
  def to_hash
@@ -4911,10 +5008,12 @@ module Io
4911
5008
  raise "Union type[authorization_form] requires a field named 'discriminator'"
4912
5009
  end
4913
5010
  case discriminator
5011
+ when Types::AUTHORIZATION_COPY_FORM; AuthorizationCopyForm.new(hash)
4914
5012
  when Types::DIRECT_AUTHORIZATION_FORM; DirectAuthorizationForm.new(hash)
4915
5013
  when Types::MERCHANT_OF_RECORD_AUTHORIZATION_FORM; MerchantOfRecordAuthorizationForm.new(hash)
4916
5014
  when Types::PAYPAL_AUTHORIZATION_FORM; PaypalAuthorizationForm.new(hash)
4917
5015
  when Types::UNIONPAY_AUTHORIZATION_FORM; UnionpayAuthorizationForm.new(hash)
5016
+ when Types::REDIRECT_AUTHORIZATION_FORM; RedirectAuthorizationForm.new(hash)
4918
5017
  else AuthorizationFormUndefinedType.new(:discriminator => discriminator)
4919
5018
  end
4920
5019
  end
@@ -5183,6 +5282,7 @@ module Io
5183
5282
  ITEM_ORIGIN_DELETED = 'item_origin_deleted' unless defined?(ITEM_ORIGIN_DELETED)
5184
5283
  HARMONIZED_ITEM_UPSERTED = 'harmonized_item_upserted' unless defined?(HARMONIZED_ITEM_UPSERTED)
5185
5284
  HARMONIZED_ITEM_DELETED = 'harmonized_item_deleted' unless defined?(HARMONIZED_ITEM_DELETED)
5285
+ HARMONIZED_LANDED_COST_UPSERTED = 'harmonized_landed_cost_upserted' unless defined?(HARMONIZED_LANDED_COST_UPSERTED)
5186
5286
  SNAPSHOT_UPSERTED = 'snapshot_upserted' unless defined?(SNAPSHOT_UPSERTED)
5187
5287
  SNAPSHOT_DELETED = 'snapshot_deleted' unless defined?(SNAPSHOT_DELETED)
5188
5288
  LABEL_UPSERTED = 'label_upserted' unless defined?(LABEL_UPSERTED)
@@ -5190,11 +5290,6 @@ module Io
5190
5290
  NOTIFICATION_DELETED = 'notification_deleted' unless defined?(NOTIFICATION_DELETED)
5191
5291
  LOCAL_ITEM_UPSERTED = 'local_item_upserted' unless defined?(LOCAL_ITEM_UPSERTED)
5192
5292
  LOCAL_ITEM_DELETED = 'local_item_deleted' unless defined?(LOCAL_ITEM_DELETED)
5193
- LOCALIZED_ITEM_UPSERTED = 'localized_item_upserted' unless defined?(LOCALIZED_ITEM_UPSERTED)
5194
- LOCALIZED_ITEM_UPSERTED_V2 = 'localized_item_upserted_v2' unless defined?(LOCALIZED_ITEM_UPSERTED_V2)
5195
- LOCALIZED_ITEM_DELETED = 'localized_item_deleted' unless defined?(LOCALIZED_ITEM_DELETED)
5196
- LOCALIZED_ITEM_DELETED_V2 = 'localized_item_deleted_v2' unless defined?(LOCALIZED_ITEM_DELETED_V2)
5197
- LOCALIZED_ITEM_SNAPSHOT = 'localized_item_snapshot' unless defined?(LOCALIZED_ITEM_SNAPSHOT)
5198
5293
  MEMBERSHIP_UPSERTED = 'membership_upserted' unless defined?(MEMBERSHIP_UPSERTED)
5199
5294
  MEMBERSHIP_DELETED = 'membership_deleted' unless defined?(MEMBERSHIP_DELETED)
5200
5295
  ORGANIZATION_UPSERTED = 'organization_upserted' unless defined?(ORGANIZATION_UPSERTED)
@@ -5237,7 +5332,7 @@ module Io
5237
5332
  end
5238
5333
 
5239
5334
  def subtype_to_hash
5240
- raise 'Cannot serialize an instance of event directly - must use one of the specific types: attribute_upserted, attribute_deleted, catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, available_promotions_upserted, available_promotions_deleted, allocation_deleted, allocation_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, item_sales_margin_deleted, item_sales_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, tier_upserted, tier_deleted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, local_item_upserted, local_item_deleted, localized_item_upserted, localized_item_upserted_v2, localized_item_deleted, localized_item_deleted_v2, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, authorization_deleted_v2, authorization_status_changed, card_authorization_upserted, card_authorization_upserted_v2, online_authorization_upserted, online_authorization_upserted_v2, capture_upserted, capture_upserted_v2, card_upserted, card_upserted_v2, card_deleted, payment_upserted, payment_deleted, refund_upserted, refund_upserted_v2, organization_rates_published, organization_countries_published, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
5335
+ raise 'Cannot serialize an instance of event directly - must use one of the specific types: attribute_upserted, attribute_deleted, catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, available_promotions_upserted, available_promotions_deleted, allocation_deleted, allocation_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, item_sales_margin_deleted, item_sales_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, tier_upserted, tier_deleted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, harmonized_landed_cost_upserted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, local_item_upserted, local_item_deleted, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, authorization_deleted_v2, authorization_status_changed, card_authorization_upserted, card_authorization_upserted_v2, online_authorization_upserted, online_authorization_upserted_v2, capture_upserted, capture_upserted_v2, card_upserted, card_upserted_v2, card_deleted, payment_upserted, payment_deleted, refund_upserted, refund_upserted_v2, organization_rates_published, organization_countries_published, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
5241
5336
  end
5242
5337
 
5243
5338
  def to_hash
@@ -5291,6 +5386,7 @@ module Io
5291
5386
  when Types::ITEM_ORIGIN_DELETED; ItemOriginDeleted.new(hash)
5292
5387
  when Types::HARMONIZED_ITEM_UPSERTED; HarmonizedItemUpserted.new(hash)
5293
5388
  when Types::HARMONIZED_ITEM_DELETED; HarmonizedItemDeleted.new(hash)
5389
+ when Types::HARMONIZED_LANDED_COST_UPSERTED; HarmonizedLandedCostUpserted.new(hash)
5294
5390
  when Types::SNAPSHOT_UPSERTED; SnapshotUpserted.new(hash)
5295
5391
  when Types::SNAPSHOT_DELETED; SnapshotDeleted.new(hash)
5296
5392
  when Types::LABEL_UPSERTED; LabelUpserted.new(hash)
@@ -5298,11 +5394,6 @@ module Io
5298
5394
  when Types::NOTIFICATION_DELETED; NotificationDeleted.new(hash)
5299
5395
  when Types::LOCAL_ITEM_UPSERTED; LocalItemUpserted.new(hash)
5300
5396
  when Types::LOCAL_ITEM_DELETED; LocalItemDeleted.new(hash)
5301
- when Types::LOCALIZED_ITEM_UPSERTED; LocalizedItemUpserted.new(hash)
5302
- when Types::LOCALIZED_ITEM_UPSERTED_V2; LocalizedItemUpsertedV2.new(hash)
5303
- when Types::LOCALIZED_ITEM_DELETED; LocalizedItemDeleted.new(hash)
5304
- when Types::LOCALIZED_ITEM_DELETED_V2; LocalizedItemDeletedV2.new(hash)
5305
- when Types::LOCALIZED_ITEM_SNAPSHOT; LocalizedItemSnapshot.new(hash)
5306
5397
  when Types::MEMBERSHIP_UPSERTED; MembershipUpserted.new(hash)
5307
5398
  when Types::MEMBERSHIP_DELETED; MembershipDeleted.new(hash)
5308
5399
  when Types::ORGANIZATION_UPSERTED; OrganizationUpserted.new(hash)
@@ -6214,6 +6305,7 @@ module Io
6214
6305
  module Types
6215
6306
  PAYPAL_AUTHORIZATION_DETAILS = 'paypal_authorization_details' unless defined?(PAYPAL_AUTHORIZATION_DETAILS)
6216
6307
  UNIONPAY_AUTHORIZATION_DETAILS = 'unionpay_authorization_details' unless defined?(UNIONPAY_AUTHORIZATION_DETAILS)
6308
+ REDIRECT_AUTHORIZATION_DETAILS = 'redirect_authorization_details' unless defined?(REDIRECT_AUTHORIZATION_DETAILS)
6217
6309
  end
6218
6310
 
6219
6311
  attr_reader :discriminator
@@ -6225,7 +6317,7 @@ module Io
6225
6317
  end
6226
6318
 
6227
6319
  def subtype_to_hash
6228
- raise 'Cannot serialize an instance of online_authorization_details directly - must use one of the specific types: paypal_authorization_details, unionpay_authorization_details'
6320
+ raise 'Cannot serialize an instance of online_authorization_details directly - must use one of the specific types: paypal_authorization_details, unionpay_authorization_details, redirect_authorization_details'
6229
6321
  end
6230
6322
 
6231
6323
  def to_hash
@@ -6241,6 +6333,7 @@ module Io
6241
6333
  case discriminator
6242
6334
  when Types::PAYPAL_AUTHORIZATION_DETAILS; PaypalAuthorizationDetails.new(hash)
6243
6335
  when Types::UNIONPAY_AUTHORIZATION_DETAILS; UnionpayAuthorizationDetails.new(hash)
6336
+ when Types::REDIRECT_AUTHORIZATION_DETAILS; RedirectAuthorizationDetails.new(hash)
6244
6337
  else OnlineAuthorizationDetailsUndefinedType.new(:discriminator => discriminator)
6245
6338
  end
6246
6339
  end
@@ -7143,55 +7236,6 @@ module Io
7143
7236
 
7144
7237
  end
7145
7238
 
7146
- class AuthorizationDeleteErrorCode
7147
-
7148
- attr_reader :value
7149
-
7150
- def initialize(value)
7151
- @value = HttpClient::Preconditions.assert_class('value', value, String)
7152
- end
7153
-
7154
- # Returns the instance of AuthorizationDeleteErrorCode for this value, creating a new instance for an unknown value
7155
- def AuthorizationDeleteErrorCode.apply(value)
7156
- if value.instance_of?(AuthorizationDeleteErrorCode)
7157
- value
7158
- else
7159
- HttpClient::Preconditions.assert_class_or_nil('value', value, String)
7160
- value.nil? ? nil : (from_string(value) || AuthorizationDeleteErrorCode.new(value))
7161
- end
7162
- end
7163
-
7164
- # Returns the instance of AuthorizationDeleteErrorCode for this value, or nil if not found
7165
- def AuthorizationDeleteErrorCode.from_string(value)
7166
- HttpClient::Preconditions.assert_class('value', value, String)
7167
- AuthorizationDeleteErrorCode.ALL.find { |v| v.value == value }
7168
- end
7169
-
7170
- def AuthorizationDeleteErrorCode.ALL
7171
- @@all ||= [AuthorizationDeleteErrorCode.expired, AuthorizationDeleteErrorCode.captured, AuthorizationDeleteErrorCode.unknown]
7172
- end
7173
-
7174
- # Payment authorization has expired
7175
- def AuthorizationDeleteErrorCode.expired
7176
- @@_expired ||= AuthorizationDeleteErrorCode.new('expired')
7177
- end
7178
-
7179
- # Payment authorization has already been captured. Please create a refund.
7180
- def AuthorizationDeleteErrorCode.captured
7181
- @@_captured ||= AuthorizationDeleteErrorCode.new('captured')
7182
- end
7183
-
7184
- # Failed due to another reason (details not known)
7185
- def AuthorizationDeleteErrorCode.unknown
7186
- @@_unknown ||= AuthorizationDeleteErrorCode.new('unknown')
7187
- end
7188
-
7189
- def to_hash
7190
- value
7191
- end
7192
-
7193
- end
7194
-
7195
7239
  class AuthorizationOption
7196
7240
 
7197
7241
  attr_reader :value
@@ -8084,7 +8128,7 @@ module Io
8084
8128
  end
8085
8129
 
8086
8130
  def EventType.ALL
8087
- @@all ||= [EventType.attribute_upserted, EventType.attribute_deleted, EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.rate_deleted, EventType.rate_upserted, EventType.available_promotions_upserted, EventType.available_promotions_deleted, EventType.allocation_deleted, EventType.allocation_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.item_sales_margin_deleted, EventType.item_sales_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_identifier_deleted, EventType.order_identifier_upserted, EventType.pricing_deleted, EventType.pricing_upserted, EventType.tier_upserted, EventType.tier_deleted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.item_origin_upserted, EventType.item_origin_deleted, EventType.harmonized_item_upserted, EventType.harmonized_item_deleted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.local_item_upserted, EventType.local_item_deleted, EventType.localized_item_upserted, EventType.localized_item_upserted_v2, EventType.localized_item_deleted, EventType.localized_item_deleted_v2, EventType.localized_item_snapshot, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.authorization_deleted_v2, EventType.authorization_status_changed, EventType.card_authorization_upserted, EventType.card_authorization_upserted_v2, EventType.online_authorization_upserted, EventType.online_authorization_upserted_v2, EventType.capture_upserted, EventType.capture_upserted_v2, EventType.card_upserted, EventType.card_upserted_v2, EventType.card_deleted, EventType.payment_upserted, EventType.payment_deleted, EventType.refund_upserted, EventType.refund_upserted_v2, EventType.organization_rates_published, EventType.organization_countries_published, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
8131
+ @@all ||= [EventType.attribute_upserted, EventType.attribute_deleted, EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.rate_deleted, EventType.rate_upserted, EventType.available_promotions_upserted, EventType.available_promotions_deleted, EventType.allocation_deleted, EventType.allocation_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.item_sales_margin_deleted, EventType.item_sales_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_identifier_deleted, EventType.order_identifier_upserted, EventType.pricing_deleted, EventType.pricing_upserted, EventType.tier_upserted, EventType.tier_deleted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.item_origin_upserted, EventType.item_origin_deleted, EventType.harmonized_item_upserted, EventType.harmonized_item_deleted, EventType.harmonized_landed_cost_upserted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.local_item_upserted, EventType.local_item_deleted, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.authorization_deleted_v2, EventType.authorization_status_changed, EventType.card_authorization_upserted, EventType.card_authorization_upserted_v2, EventType.online_authorization_upserted, EventType.online_authorization_upserted_v2, EventType.capture_upserted, EventType.capture_upserted_v2, EventType.card_upserted, EventType.card_upserted_v2, EventType.card_deleted, EventType.payment_upserted, EventType.payment_deleted, EventType.refund_upserted, EventType.refund_upserted_v2, EventType.organization_rates_published, EventType.organization_countries_published, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
8088
8132
  end
8089
8133
 
8090
8134
  def EventType.attribute_upserted
@@ -8247,6 +8291,10 @@ module Io
8247
8291
  @@_harmonized_item_deleted ||= EventType.new('harmonized_item_deleted')
8248
8292
  end
8249
8293
 
8294
+ def EventType.harmonized_landed_cost_upserted
8295
+ @@_harmonized_landed_cost_upserted ||= EventType.new('harmonized_landed_cost_upserted')
8296
+ end
8297
+
8250
8298
  def EventType.snapshot_upserted
8251
8299
  @@_snapshot_upserted ||= EventType.new('snapshot_upserted')
8252
8300
  end
@@ -8275,26 +8323,6 @@ module Io
8275
8323
  @@_local_item_deleted ||= EventType.new('local_item_deleted')
8276
8324
  end
8277
8325
 
8278
- def EventType.localized_item_upserted
8279
- @@_localized_item_upserted ||= EventType.new('localized_item_upserted')
8280
- end
8281
-
8282
- def EventType.localized_item_upserted_v2
8283
- @@_localized_item_upserted_v2 ||= EventType.new('localized_item_upserted_v2')
8284
- end
8285
-
8286
- def EventType.localized_item_deleted
8287
- @@_localized_item_deleted ||= EventType.new('localized_item_deleted')
8288
- end
8289
-
8290
- def EventType.localized_item_deleted_v2
8291
- @@_localized_item_deleted_v2 ||= EventType.new('localized_item_deleted_v2')
8292
- end
8293
-
8294
- def EventType.localized_item_snapshot
8295
- @@_localized_item_snapshot ||= EventType.new('localized_item_snapshot')
8296
- end
8297
-
8298
8326
  def EventType.membership_upserted
8299
8327
  @@_membership_upserted ||= EventType.new('membership_upserted')
8300
8328
  end
@@ -9312,10 +9340,15 @@ module Io
9312
9340
  @@_order_item_not_available ||= OrderErrorCode.new('order_item_not_available')
9313
9341
  end
9314
9342
 
9343
+ # Indicates that there is no order with the specified number (nor an order for
9344
+ # which an order identifier with that number has been created)
9315
9345
  def OrderErrorCode.order_identifier_error
9316
9346
  @@_order_identifier_error ||= OrderErrorCode.new('order_identifier_error')
9317
9347
  end
9318
9348
 
9349
+ # Indicates that an order was created for a country to which you have asked Flow
9350
+ # not to ship. Usually this indicates an error that a request was made to create
9351
+ # an order for your domestic country
9319
9352
  def OrderErrorCode.domestic_shipping_unavailable
9320
9353
  @@_domestic_shipping_unavailable ||= OrderErrorCode.new('domestic_shipping_unavailable')
9321
9354
  end
@@ -10430,6 +10463,110 @@ module Io
10430
10463
 
10431
10464
  end
10432
10465
 
10466
+ class ReversalErrorCode
10467
+
10468
+ attr_reader :value
10469
+
10470
+ def initialize(value)
10471
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
10472
+ end
10473
+
10474
+ # Returns the instance of ReversalErrorCode for this value, creating a new instance for an unknown value
10475
+ def ReversalErrorCode.apply(value)
10476
+ if value.instance_of?(ReversalErrorCode)
10477
+ value
10478
+ else
10479
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
10480
+ value.nil? ? nil : (from_string(value) || ReversalErrorCode.new(value))
10481
+ end
10482
+ end
10483
+
10484
+ # Returns the instance of ReversalErrorCode for this value, or nil if not found
10485
+ def ReversalErrorCode.from_string(value)
10486
+ HttpClient::Preconditions.assert_class('value', value, String)
10487
+ ReversalErrorCode.ALL.find { |v| v.value == value }
10488
+ end
10489
+
10490
+ def ReversalErrorCode.ALL
10491
+ @@all ||= [ReversalErrorCode.authorization_declined, ReversalErrorCode.authorization_reversed, ReversalErrorCode.authorization_captured, ReversalErrorCode.unknown]
10492
+ end
10493
+
10494
+ # The authorization has been declined.
10495
+ def ReversalErrorCode.authorization_declined
10496
+ @@_authorization_declined ||= ReversalErrorCode.new('authorization_declined')
10497
+ end
10498
+
10499
+ # The authorization has already been reversed.
10500
+ def ReversalErrorCode.authorization_reversed
10501
+ @@_authorization_reversed ||= ReversalErrorCode.new('authorization_reversed')
10502
+ end
10503
+
10504
+ # It's too late to reverse the authorization, because it has already been
10505
+ # captured. Create a refund instead.
10506
+ def ReversalErrorCode.authorization_captured
10507
+ @@_authorization_captured ||= ReversalErrorCode.new('authorization_captured')
10508
+ end
10509
+
10510
+ # Unknown or other
10511
+ def ReversalErrorCode.unknown
10512
+ @@_unknown ||= ReversalErrorCode.new('unknown')
10513
+ end
10514
+
10515
+ def to_hash
10516
+ value
10517
+ end
10518
+
10519
+ end
10520
+
10521
+ class ReversalStatus
10522
+
10523
+ attr_reader :value
10524
+
10525
+ def initialize(value)
10526
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
10527
+ end
10528
+
10529
+ # Returns the instance of ReversalStatus for this value, creating a new instance for an unknown value
10530
+ def ReversalStatus.apply(value)
10531
+ if value.instance_of?(ReversalStatus)
10532
+ value
10533
+ else
10534
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
10535
+ value.nil? ? nil : (from_string(value) || ReversalStatus.new(value))
10536
+ end
10537
+ end
10538
+
10539
+ # Returns the instance of ReversalStatus for this value, or nil if not found
10540
+ def ReversalStatus.from_string(value)
10541
+ HttpClient::Preconditions.assert_class('value', value, String)
10542
+ ReversalStatus.ALL.find { |v| v.value == value }
10543
+ end
10544
+
10545
+ def ReversalStatus.ALL
10546
+ @@all ||= [ReversalStatus.pending, ReversalStatus.processed, ReversalStatus.failed]
10547
+ end
10548
+
10549
+ # Reversal is pending processing
10550
+ def ReversalStatus.pending
10551
+ @@_pending ||= ReversalStatus.new('pending')
10552
+ end
10553
+
10554
+ # Reversal has been processed successfully.
10555
+ def ReversalStatus.processed
10556
+ @@_processed ||= ReversalStatus.new('processed')
10557
+ end
10558
+
10559
+ # Reversal failed to process
10560
+ def ReversalStatus.failed
10561
+ @@_failed ||= ReversalStatus.new('failed')
10562
+ end
10563
+
10564
+ def to_hash
10565
+ value
10566
+ end
10567
+
10568
+ end
10569
+
10433
10570
  class Role
10434
10571
 
10435
10572
  attr_reader :value
@@ -12320,15 +12457,22 @@ module Io
12320
12457
 
12321
12458
  end
12322
12459
 
12323
- class AuthorizationDeleteError
12460
+ # Creates a new authorization based on the underlying information in an existing
12461
+ # authorization. A common use case here is to create a new auth when the
12462
+ # existing one has expired.
12463
+ class AuthorizationCopyForm < AuthorizationForm
12324
12464
 
12325
- attr_reader :code, :messages
12465
+ attr_reader :source_authorization_key, :amount, :currency, :key, :attributes
12326
12466
 
12327
12467
  def initialize(incoming={})
12468
+ super(:discriminator => AuthorizationForm::Types::AUTHORIZATION_COPY_FORM)
12328
12469
  opts = HttpClient::Helper.symbolize_keys(incoming)
12329
- HttpClient::Preconditions.require_keys(opts, [:code, :messages], 'AuthorizationDeleteError')
12330
- @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::AuthorizationDeleteErrorCode) ? x : ::Io::Flow::V0::Models::AuthorizationDeleteErrorCode.apply(x))
12331
- @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
12470
+ HttpClient::Preconditions.require_keys(opts, [:source_authorization_key, :amount, :currency], 'AuthorizationCopyForm')
12471
+ @source_authorization_key = HttpClient::Preconditions.assert_class('source_authorization_key', opts.delete(:source_authorization_key), String)
12472
+ @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
12473
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
12474
+ @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
12475
+ @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
12332
12476
  end
12333
12477
 
12334
12478
  def to_json
@@ -12336,13 +12480,16 @@ module Io
12336
12480
  end
12337
12481
 
12338
12482
  def copy(incoming={})
12339
- AuthorizationDeleteError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12483
+ AuthorizationCopyForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12340
12484
  end
12341
12485
 
12342
- def to_hash
12486
+ def subtype_to_hash
12343
12487
  {
12344
- :code => code.value,
12345
- :messages => messages
12488
+ :source_authorization_key => source_authorization_key,
12489
+ :amount => amount,
12490
+ :currency => currency,
12491
+ :key => key,
12492
+ :attributes => attributes.nil? ? nil : attributes
12346
12493
  }
12347
12494
  end
12348
12495
 
@@ -13030,7 +13177,7 @@ module Io
13030
13177
  # capture up to the amount of the authorization.
13031
13178
  class CardAuthorization < Authorization
13032
13179
 
13033
- attr_reader :id, :key, :card, :amount, :currency, :customer, :attributes, :destination, :order, :ip, :result, :created_at
13180
+ attr_reader :id, :key, :card, :amount, :currency, :customer, :attributes, :destination, :order, :ip, :result, :created_at, :expires_at
13034
13181
 
13035
13182
  def initialize(incoming={})
13036
13183
  super(:discriminator => Authorization::Types::CARD_AUTHORIZATION)
@@ -13048,6 +13195,7 @@ module Io
13048
13195
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
13049
13196
  @result = (x = opts.delete(:result); x.is_a?(::Io::Flow::V0::Models::AuthorizationResult) ? x : ::Io::Flow::V0::Models::AuthorizationResult.new(x))
13050
13197
  @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
13198
+ @expires_at = (x = opts.delete(:expires_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
13051
13199
  end
13052
13200
 
13053
13201
  def to_json
@@ -13071,7 +13219,8 @@ module Io
13071
13219
  :order => order.nil? ? nil : order.to_hash,
13072
13220
  :ip => ip,
13073
13221
  :result => result.to_hash,
13074
- :created_at => created_at
13222
+ :created_at => created_at,
13223
+ :expires_at => expires_at
13075
13224
  }
13076
13225
  end
13077
13226
 
@@ -16882,6 +17031,41 @@ module Io
16882
17031
 
16883
17032
  end
16884
17033
 
17034
+ class HarmonizedLandedCostUpserted < Event
17035
+
17036
+ attr_reader :event_id, :timestamp, :organization, :id, :landed_cost
17037
+
17038
+ def initialize(incoming={})
17039
+ super(:discriminator => Event::Types::HARMONIZED_LANDED_COST_UPSERTED)
17040
+ opts = HttpClient::Helper.symbolize_keys(incoming)
17041
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :landed_cost], 'HarmonizedLandedCostUpserted')
17042
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
17043
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
17044
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
17045
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
17046
+ @landed_cost = (x = opts.delete(:landed_cost); x.is_a?(::Io::Flow::V0::Models::HarmonizedLandedCost) ? x : ::Io::Flow::V0::Models::HarmonizedLandedCost.new(x))
17047
+ end
17048
+
17049
+ def to_json
17050
+ JSON.dump(to_hash)
17051
+ end
17052
+
17053
+ def copy(incoming={})
17054
+ HarmonizedLandedCostUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
17055
+ end
17056
+
17057
+ def subtype_to_hash
17058
+ {
17059
+ :event_id => event_id,
17060
+ :timestamp => timestamp,
17061
+ :organization => organization,
17062
+ :id => id,
17063
+ :landed_cost => landed_cost.to_hash
17064
+ }
17065
+ end
17066
+
17067
+ end
17068
+
16885
17069
  class Header
16886
17070
 
16887
17071
  attr_reader :name, :value
@@ -19505,19 +19689,19 @@ module Io
19505
19689
 
19506
19690
  end
19507
19691
 
19508
- class LocalizedItemDeleted < Event
19692
+ class LocalizedItemDuty < LocalizedPrice
19509
19693
 
19510
- attr_reader :event_id, :timestamp, :organization, :number, :catalog
19694
+ attr_reader :currency, :amount, :label, :base, :adjustment
19511
19695
 
19512
19696
  def initialize(incoming={})
19513
- super(:discriminator => Event::Types::LOCALIZED_ITEM_DELETED)
19697
+ super(:key => LocalizedPrice::Types::LOCALIZED_ITEM_DUTY)
19514
19698
  opts = HttpClient::Helper.symbolize_keys(incoming)
19515
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :catalog], 'LocalizedItemDeleted')
19516
- @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
19517
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
19518
- @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
19519
- @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
19520
- @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
19699
+ HttpClient::Preconditions.require_keys(opts, [:currency, :amount, :label, :base], 'LocalizedItemDuty')
19700
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
19701
+ @amount = HttpClient::Preconditions.assert_class('amount', opts.delete(:amount), Numeric)
19702
+ @label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String)
19703
+ @base = (x = opts.delete(:base); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
19704
+ @adjustment = (x = opts.delete(:adjustment); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LocalizedAdjustment) ? x : ::Io::Flow::V0::Models::LocalizedAdjustment.new(x)))
19521
19705
  end
19522
19706
 
19523
19707
  def to_json
@@ -19525,95 +19709,27 @@ module Io
19525
19709
  end
19526
19710
 
19527
19711
  def copy(incoming={})
19528
- LocalizedItemDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19712
+ LocalizedItemDuty.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19529
19713
  end
19530
19714
 
19531
19715
  def subtype_to_hash
19532
19716
  {
19533
- :event_id => event_id,
19534
- :timestamp => timestamp,
19535
- :organization => organization,
19536
- :number => number,
19537
- :catalog => catalog
19717
+ :currency => currency,
19718
+ :amount => amount,
19719
+ :label => label,
19720
+ :base => base.to_hash,
19721
+ :adjustment => adjustment.nil? ? nil : adjustment.to_hash
19538
19722
  }
19539
19723
  end
19540
19724
 
19541
19725
  end
19542
19726
 
19543
- class LocalizedItemDeletedV2 < Event
19727
+ class LocalizedItemPrice < LocalizedPrice
19544
19728
 
19545
- attr_reader :event_id, :timestamp, :organization, :id
19729
+ attr_reader :currency, :amount, :label, :base, :includes
19546
19730
 
19547
19731
  def initialize(incoming={})
19548
- super(:discriminator => Event::Types::LOCALIZED_ITEM_DELETED_V2)
19549
- opts = HttpClient::Helper.symbolize_keys(incoming)
19550
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id], 'LocalizedItemDeletedV2')
19551
- @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
19552
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
19553
- @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
19554
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
19555
- end
19556
-
19557
- def to_json
19558
- JSON.dump(to_hash)
19559
- end
19560
-
19561
- def copy(incoming={})
19562
- LocalizedItemDeletedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19563
- end
19564
-
19565
- def subtype_to_hash
19566
- {
19567
- :event_id => event_id,
19568
- :timestamp => timestamp,
19569
- :organization => organization,
19570
- :id => id
19571
- }
19572
- end
19573
-
19574
- end
19575
-
19576
- class LocalizedItemDuty < LocalizedPrice
19577
-
19578
- attr_reader :currency, :amount, :label, :base, :adjustment
19579
-
19580
- def initialize(incoming={})
19581
- super(:key => LocalizedPrice::Types::LOCALIZED_ITEM_DUTY)
19582
- opts = HttpClient::Helper.symbolize_keys(incoming)
19583
- HttpClient::Preconditions.require_keys(opts, [:currency, :amount, :label, :base], 'LocalizedItemDuty')
19584
- @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
19585
- @amount = HttpClient::Preconditions.assert_class('amount', opts.delete(:amount), Numeric)
19586
- @label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String)
19587
- @base = (x = opts.delete(:base); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
19588
- @adjustment = (x = opts.delete(:adjustment); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LocalizedAdjustment) ? x : ::Io::Flow::V0::Models::LocalizedAdjustment.new(x)))
19589
- end
19590
-
19591
- def to_json
19592
- JSON.dump(to_hash)
19593
- end
19594
-
19595
- def copy(incoming={})
19596
- LocalizedItemDuty.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19597
- end
19598
-
19599
- def subtype_to_hash
19600
- {
19601
- :currency => currency,
19602
- :amount => amount,
19603
- :label => label,
19604
- :base => base.to_hash,
19605
- :adjustment => adjustment.nil? ? nil : adjustment.to_hash
19606
- }
19607
- end
19608
-
19609
- end
19610
-
19611
- class LocalizedItemPrice < LocalizedPrice
19612
-
19613
- attr_reader :currency, :amount, :label, :base, :includes
19614
-
19615
- def initialize(incoming={})
19616
- super(:key => LocalizedPrice::Types::LOCALIZED_ITEM_PRICE)
19732
+ super(:key => LocalizedPrice::Types::LOCALIZED_ITEM_PRICE)
19617
19733
  opts = HttpClient::Helper.symbolize_keys(incoming)
19618
19734
  HttpClient::Preconditions.require_keys(opts, [:currency, :amount, :label, :base], 'LocalizedItemPrice')
19619
19735
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
@@ -19643,133 +19759,6 @@ module Io
19643
19759
 
19644
19760
  end
19645
19761
 
19646
- class LocalizedItemSnapshot < Event
19647
-
19648
- attr_reader :event_id, :timestamp, :organization, :subcatalog_id, :url
19649
-
19650
- def initialize(incoming={})
19651
- super(:discriminator => Event::Types::LOCALIZED_ITEM_SNAPSHOT)
19652
- opts = HttpClient::Helper.symbolize_keys(incoming)
19653
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :subcatalog_id, :url], 'LocalizedItemSnapshot')
19654
- @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
19655
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
19656
- @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
19657
- @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
19658
- @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
19659
- end
19660
-
19661
- def to_json
19662
- JSON.dump(to_hash)
19663
- end
19664
-
19665
- def copy(incoming={})
19666
- LocalizedItemSnapshot.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19667
- end
19668
-
19669
- def subtype_to_hash
19670
- {
19671
- :event_id => event_id,
19672
- :timestamp => timestamp,
19673
- :organization => organization,
19674
- :subcatalog_id => subcatalog_id,
19675
- :url => url
19676
- }
19677
- end
19678
-
19679
- end
19680
-
19681
- class LocalizedItemUpserted < Event
19682
-
19683
- attr_reader :event_id, :timestamp, :organization, :number, :catalog, :locale, :name, :currency, :price, :categories, :description, :attributes, :dimensions, :images, :local
19684
-
19685
- def initialize(incoming={})
19686
- super(:discriminator => Event::Types::LOCALIZED_ITEM_UPSERTED)
19687
- opts = HttpClient::Helper.symbolize_keys(incoming)
19688
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :catalog, :locale, :name, :currency, :price, :categories, :attributes, :dimensions, :images, :local], 'LocalizedItemUpserted')
19689
- @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
19690
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
19691
- @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
19692
- @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
19693
- @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
19694
- @locale = HttpClient::Preconditions.assert_class('locale', opts.delete(:locale), String)
19695
- @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
19696
- @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
19697
- @price = HttpClient::Preconditions.assert_class('price', opts.delete(:price), Numeric)
19698
- @categories = HttpClient::Preconditions.assert_class('categories', opts.delete(:categories), Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }
19699
- @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
19700
- @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
19701
- @dimensions = HttpClient::Preconditions.assert_class('dimensions', HttpClient::Helper.to_object(opts.delete(:dimensions)), Hash)
19702
- @images = HttpClient::Preconditions.assert_class('images', opts.delete(:images), Array).map { |v| HttpClient::Preconditions.assert_class('images', HttpClient::Helper.to_object(v), Hash) }
19703
- @local = HttpClient::Preconditions.assert_class('local', HttpClient::Helper.to_object(opts.delete(:local)), Hash)
19704
- end
19705
-
19706
- def to_json
19707
- JSON.dump(to_hash)
19708
- end
19709
-
19710
- def copy(incoming={})
19711
- LocalizedItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19712
- end
19713
-
19714
- def subtype_to_hash
19715
- {
19716
- :event_id => event_id,
19717
- :timestamp => timestamp,
19718
- :organization => organization,
19719
- :number => number,
19720
- :catalog => catalog,
19721
- :locale => locale,
19722
- :name => name,
19723
- :currency => currency,
19724
- :price => price,
19725
- :categories => categories,
19726
- :description => description,
19727
- :attributes => attributes,
19728
- :dimensions => dimensions,
19729
- :images => images,
19730
- :local => local
19731
- }
19732
- end
19733
-
19734
- end
19735
-
19736
- class LocalizedItemUpsertedV2 < Event
19737
-
19738
- attr_reader :event_id, :timestamp, :organization, :id, :item, :catalog
19739
-
19740
- def initialize(incoming={})
19741
- super(:discriminator => Event::Types::LOCALIZED_ITEM_UPSERTED_V2)
19742
- opts = HttpClient::Helper.symbolize_keys(incoming)
19743
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :item, :catalog], 'LocalizedItemUpsertedV2')
19744
- @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
19745
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
19746
- @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
19747
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
19748
- @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::Item) ? x : ::Io::Flow::V0::Models::Item.new(x))
19749
- @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
19750
- end
19751
-
19752
- def to_json
19753
- JSON.dump(to_hash)
19754
- end
19755
-
19756
- def copy(incoming={})
19757
- LocalizedItemUpsertedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19758
- end
19759
-
19760
- def subtype_to_hash
19761
- {
19762
- :event_id => event_id,
19763
- :timestamp => timestamp,
19764
- :organization => organization,
19765
- :id => id,
19766
- :item => item.to_hash,
19767
- :catalog => catalog
19768
- }
19769
- end
19770
-
19771
- end
19772
-
19773
19762
  class LocalizedItemVat < LocalizedPrice
19774
19763
 
19775
19764
  attr_reader :currency, :amount, :label, :base, :name, :adjustment
@@ -20491,7 +20480,7 @@ module Io
20491
20480
 
20492
20481
  class OnlineAuthorization < Authorization
20493
20482
 
20494
- attr_reader :id, :key, :method, :details, :payment, :amount, :currency, :customer, :attributes, :destination, :order, :ip, :result, :created_at
20483
+ attr_reader :id, :key, :method, :details, :payment, :amount, :currency, :customer, :attributes, :destination, :order, :ip, :result, :created_at, :expires_at
20495
20484
 
20496
20485
  def initialize(incoming={})
20497
20486
  super(:discriminator => Authorization::Types::ONLINE_AUTHORIZATION)
@@ -20511,6 +20500,7 @@ module Io
20511
20500
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
20512
20501
  @result = (x = opts.delete(:result); x.is_a?(::Io::Flow::V0::Models::AuthorizationResult) ? x : ::Io::Flow::V0::Models::AuthorizationResult.new(x))
20513
20502
  @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
20503
+ @expires_at = (x = opts.delete(:expires_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
20514
20504
  end
20515
20505
 
20516
20506
  def to_json
@@ -20536,7 +20526,8 @@ module Io
20536
20526
  :order => order.nil? ? nil : order.to_hash,
20537
20527
  :ip => ip,
20538
20528
  :result => result.to_hash,
20539
- :created_at => created_at
20529
+ :created_at => created_at,
20530
+ :expires_at => expires_at
20540
20531
  }
20541
20532
  end
20542
20533
 
@@ -23989,6 +23980,79 @@ module Io
23989
23980
 
23990
23981
  end
23991
23982
 
23983
+ # Represents an online payment that requires the user to redirect to another
23984
+ # site before entering their payment information.
23985
+ class RedirectAuthorizationDetails < OnlineAuthorizationDetails
23986
+
23987
+ attr_reader :id, :payment_redirect_url
23988
+
23989
+ def initialize(incoming={})
23990
+ super(:discriminator => OnlineAuthorizationDetails::Types::REDIRECT_AUTHORIZATION_DETAILS)
23991
+ opts = HttpClient::Helper.symbolize_keys(incoming)
23992
+ HttpClient::Preconditions.require_keys(opts, [:id, :payment_redirect_url], 'RedirectAuthorizationDetails')
23993
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
23994
+ @payment_redirect_url = HttpClient::Preconditions.assert_class('payment_redirect_url', opts.delete(:payment_redirect_url), String)
23995
+ end
23996
+
23997
+ def to_json
23998
+ JSON.dump(to_hash)
23999
+ end
24000
+
24001
+ def copy(incoming={})
24002
+ RedirectAuthorizationDetails.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
24003
+ end
24004
+
24005
+ def subtype_to_hash
24006
+ {
24007
+ :id => id,
24008
+ :payment_redirect_url => payment_redirect_url
24009
+ }
24010
+ end
24011
+
24012
+ end
24013
+
24014
+ # Executes a redirect-based payment based on the provided payment method.
24015
+ class RedirectAuthorizationForm < AuthorizationForm
24016
+
24017
+ attr_reader :method, :order_number, :amount, :currency, :redirect_urls, :key, :attributes, :ip
24018
+
24019
+ def initialize(incoming={})
24020
+ super(:discriminator => AuthorizationForm::Types::REDIRECT_AUTHORIZATION_FORM)
24021
+ opts = HttpClient::Helper.symbolize_keys(incoming)
24022
+ HttpClient::Preconditions.require_keys(opts, [:method, :order_number, :amount, :currency, :redirect_urls], 'RedirectAuthorizationForm')
24023
+ @method = HttpClient::Preconditions.assert_class('method', opts.delete(:method), String)
24024
+ @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
24025
+ @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
24026
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
24027
+ @redirect_urls = (x = opts.delete(:redirect_urls); x.is_a?(::Io::Flow::V0::Models::PostPaymentRedirectUrls) ? x : ::Io::Flow::V0::Models::PostPaymentRedirectUrls.new(x))
24028
+ @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
24029
+ @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
24030
+ @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
24031
+ end
24032
+
24033
+ def to_json
24034
+ JSON.dump(to_hash)
24035
+ end
24036
+
24037
+ def copy(incoming={})
24038
+ RedirectAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
24039
+ end
24040
+
24041
+ def subtype_to_hash
24042
+ {
24043
+ :method => method,
24044
+ :order_number => order_number,
24045
+ :amount => amount,
24046
+ :currency => currency,
24047
+ :redirect_urls => redirect_urls.to_hash,
24048
+ :key => key,
24049
+ :attributes => attributes.nil? ? nil : attributes,
24050
+ :ip => ip
24051
+ }
24052
+ end
24053
+
24054
+ end
24055
+
23992
24056
  # Refunds can be created against either a specific capture or an authorization
23993
24057
  # (in which case we will select 1 or more specific captures against which to
23994
24058
  # execute the refund).
@@ -24781,6 +24845,173 @@ module Io
24781
24845
 
24782
24846
  end
24783
24847
 
24848
+ # A reversal is used to clear an authorization (full or partial).
24849
+ class Reversal
24850
+
24851
+ attr_reader :id, :key, :authorization, :status, :amount, :currency, :created_at, :attributes
24852
+
24853
+ def initialize(incoming={})
24854
+ opts = HttpClient::Helper.symbolize_keys(incoming)
24855
+ HttpClient::Preconditions.require_keys(opts, [:id, :key, :authorization, :status, :amount, :currency, :created_at, :attributes], 'Reversal')
24856
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
24857
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
24858
+ @authorization = (x = opts.delete(:authorization); x.is_a?(::Io::Flow::V0::Models::AuthorizationReference) ? x : ::Io::Flow::V0::Models::AuthorizationReference.new(x))
24859
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::ReversalStatus) ? x : ::Io::Flow::V0::Models::ReversalStatus.apply(x))
24860
+ @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
24861
+ @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
24862
+ @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
24863
+ @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
24864
+ end
24865
+
24866
+ def to_json
24867
+ JSON.dump(to_hash)
24868
+ end
24869
+
24870
+ def copy(incoming={})
24871
+ Reversal.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
24872
+ end
24873
+
24874
+ def to_hash
24875
+ {
24876
+ :id => id,
24877
+ :key => key,
24878
+ :authorization => authorization.to_hash,
24879
+ :status => status.value,
24880
+ :amount => amount,
24881
+ :currency => currency,
24882
+ :created_at => created_at,
24883
+ :attributes => attributes
24884
+ }
24885
+ end
24886
+
24887
+ end
24888
+
24889
+ class ReversalError
24890
+
24891
+ attr_reader :code, :messages
24892
+
24893
+ def initialize(incoming={})
24894
+ opts = HttpClient::Helper.symbolize_keys(incoming)
24895
+ HttpClient::Preconditions.require_keys(opts, [:code, :messages], 'ReversalError')
24896
+ @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::ReversalErrorCode) ? x : ::Io::Flow::V0::Models::ReversalErrorCode.apply(x))
24897
+ @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
24898
+ end
24899
+
24900
+ def to_json
24901
+ JSON.dump(to_hash)
24902
+ end
24903
+
24904
+ def copy(incoming={})
24905
+ ReversalError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
24906
+ end
24907
+
24908
+ def to_hash
24909
+ {
24910
+ :code => code.value,
24911
+ :messages => messages
24912
+ }
24913
+ end
24914
+
24915
+ end
24916
+
24917
+ class ReversalForm
24918
+
24919
+ attr_reader :key, :authorization_id, :amount, :currency, :attributes
24920
+
24921
+ def initialize(incoming={})
24922
+ opts = HttpClient::Helper.symbolize_keys(incoming)
24923
+ HttpClient::Preconditions.require_keys(opts, [:authorization_id], 'ReversalForm')
24924
+ @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
24925
+ @authorization_id = HttpClient::Preconditions.assert_class('authorization_id', opts.delete(:authorization_id), String)
24926
+ @amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
24927
+ @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
24928
+ @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
24929
+ end
24930
+
24931
+ def to_json
24932
+ JSON.dump(to_hash)
24933
+ end
24934
+
24935
+ def copy(incoming={})
24936
+ ReversalForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
24937
+ end
24938
+
24939
+ def to_hash
24940
+ {
24941
+ :key => key,
24942
+ :authorization_id => authorization_id,
24943
+ :amount => amount,
24944
+ :currency => currency,
24945
+ :attributes => attributes.nil? ? nil : attributes
24946
+ }
24947
+ end
24948
+
24949
+ end
24950
+
24951
+ class ReversalPutForm
24952
+
24953
+ attr_reader :authorization_id, :amount, :currency, :attributes
24954
+
24955
+ def initialize(incoming={})
24956
+ opts = HttpClient::Helper.symbolize_keys(incoming)
24957
+ HttpClient::Preconditions.require_keys(opts, [:authorization_id], 'ReversalPutForm')
24958
+ @authorization_id = HttpClient::Preconditions.assert_class('authorization_id', opts.delete(:authorization_id), String)
24959
+ @amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
24960
+ @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
24961
+ @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
24962
+ end
24963
+
24964
+ def to_json
24965
+ JSON.dump(to_hash)
24966
+ end
24967
+
24968
+ def copy(incoming={})
24969
+ ReversalPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
24970
+ end
24971
+
24972
+ def to_hash
24973
+ {
24974
+ :authorization_id => authorization_id,
24975
+ :amount => amount,
24976
+ :currency => currency,
24977
+ :attributes => attributes.nil? ? nil : attributes
24978
+ }
24979
+ end
24980
+
24981
+ end
24982
+
24983
+ class ReversalVersion
24984
+
24985
+ attr_reader :id, :timestamp, :type, :reversal
24986
+
24987
+ def initialize(incoming={})
24988
+ opts = HttpClient::Helper.symbolize_keys(incoming)
24989
+ HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :reversal], 'ReversalVersion')
24990
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
24991
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
24992
+ @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
24993
+ @reversal = (x = opts.delete(:reversal); x.is_a?(::Io::Flow::V0::Models::Reversal) ? x : ::Io::Flow::V0::Models::Reversal.new(x))
24994
+ end
24995
+
24996
+ def to_json
24997
+ JSON.dump(to_hash)
24998
+ end
24999
+
25000
+ def copy(incoming={})
25001
+ ReversalVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
25002
+ end
25003
+
25004
+ def to_hash
25005
+ {
25006
+ :id => id,
25007
+ :timestamp => timestamp,
25008
+ :type => type.value,
25009
+ :reversal => reversal.to_hash
25010
+ }
25011
+ end
25012
+
25013
+ end
25014
+
24784
25015
  class Rounding
24785
25016
 
24786
25017
  attr_reader :type, :method, :value
@@ -27739,7 +27970,7 @@ module Io
27739
27970
 
27740
27971
  end
27741
27972
 
27742
- # Represents on line payment
27973
+ # Represents online payment through UnionPay
27743
27974
  class UnionpayAuthorizationDetails < OnlineAuthorizationDetails
27744
27975
 
27745
27976
  attr_reader :id, :payment_redirect_url
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.30
4
+ version: 0.2.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flow Commerce, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-15 00:00:00.000000000 Z
11
+ date: 2017-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json