flowcommerce 0.2.10 → 0.2.11

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: 07977dbffd6ef934924abe5e55cf24fe7c7bbd48
4
- data.tar.gz: 7c38857c24ca51900e008707fe6ec95a5a85b6a2
3
+ metadata.gz: 690624be868a9121a4e352cd50287ab7ebd16ccd
4
+ data.tar.gz: ab6e14b0b2a8790c6cd7a340a6ca33e4468e8920
5
5
  SHA512:
6
- metadata.gz: 3b4f5bee172a2651becfd6885c5fddecc6e7279fa8f5d73d6f5fe659354e35dabd363b8490ce42b57a36dc4c05066d3995b32904e02b24891fb264b81357ec6c
7
- data.tar.gz: 84bcda1ee9c6e9f0c21d445d5df1aef5689987e49d93436a88a5991acd23dddf36370142a052b4b346075a952273f2d915974fc38ac6194facf125313847b7c4
6
+ metadata.gz: 50ee7f994a28b8716a09ef457e1723cf1eeec5d437dcba854f090ecc05678a6d9eb5a1c6f7987bce865abdd683be124b34d36900800fd90e830d2b139c79fe37
7
+ data.tar.gz: b067528c1206b1b4ff1eb81839b0e4f149dc8e4a8042263b4ca022418f4bf1ec7aaadede89b017a0a81aea380e8c13e68999f431c91fd03ddfbc707ecb78d70b
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.2.87
3
- # apidoc:0.11.76 http://www.apidoc.me/flow/api/0.3.12/ruby_client
3
+ # apidoc:0.11.76 http://www.apidoc.me/flow/api/0.3.16/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 = 'apidoc:0.11.76 http://www.apidoc.me/flow/api/0.3.12/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.76 http://www.apidoc.me/flow/api/0.3.16/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.2.87' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -2102,10 +2102,14 @@ module Io
2102
2102
  end
2103
2103
 
2104
2104
  # Create a new authorization.
2105
- def post(organization, authorization_form)
2105
+ def post(organization, authorization_form, incoming={})
2106
2106
  HttpClient::Preconditions.assert_class('organization', organization, String)
2107
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2108
+ query = {
2109
+ :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
2110
+ }.delete_if { |k, v| v.nil? }
2107
2111
  HttpClient::Preconditions.assert_class('authorization_form', authorization_form, ::Io::Flow::V0::Models::AuthorizationForm)
2108
- r = @client.request("/#{CGI.escape(organization)}/authorizations").with_json(authorization_form.to_json).post
2112
+ r = @client.request("/#{CGI.escape(organization)}/authorizations").with_query(query).with_json(authorization_form.to_json).post
2109
2113
  ::Io::Flow::V0::Models::Authorization.from_json(r)
2110
2114
  end
2111
2115
 
@@ -4726,18 +4730,24 @@ module Io
4726
4730
  ORGANIZATION_DELETED = 'organization_deleted' unless defined?(ORGANIZATION_DELETED)
4727
4731
  AUTHORIZATION_UPSERTED = 'authorization_upserted' unless defined?(AUTHORIZATION_UPSERTED)
4728
4732
  AUTHORIZATION_DELETED = 'authorization_deleted' unless defined?(AUTHORIZATION_DELETED)
4733
+ AUTHORIZATION_DELETED_V2 = 'authorization_deleted_v2' unless defined?(AUTHORIZATION_DELETED_V2)
4729
4734
  # Trigger whenever an auth status changes (e.g. from pending to authorized).
4730
4735
  # Common use case is to subscribe to this event to know when an auth is cleared
4731
4736
  # from fraud review.
4732
4737
  AUTHORIZATION_STATUS_CHANGED = 'authorization_status_changed' unless defined?(AUTHORIZATION_STATUS_CHANGED)
4733
4738
  CARD_AUTHORIZATION_UPSERTED = 'card_authorization_upserted' unless defined?(CARD_AUTHORIZATION_UPSERTED)
4739
+ CARD_AUTHORIZATION_UPSERTED_V2 = 'card_authorization_upserted_v2' unless defined?(CARD_AUTHORIZATION_UPSERTED_V2)
4734
4740
  ONLINE_AUTHORIZATION_UPSERTED = 'online_authorization_upserted' unless defined?(ONLINE_AUTHORIZATION_UPSERTED)
4741
+ ONLINE_AUTHORIZATION_UPSERTED_V2 = 'online_authorization_upserted_v2' unless defined?(ONLINE_AUTHORIZATION_UPSERTED_V2)
4735
4742
  CAPTURE_UPSERTED = 'capture_upserted' unless defined?(CAPTURE_UPSERTED)
4743
+ CAPTURE_UPSERTED_V2 = 'capture_upserted_v2' unless defined?(CAPTURE_UPSERTED_V2)
4736
4744
  CARD_UPSERTED = 'card_upserted' unless defined?(CARD_UPSERTED)
4745
+ CARD_UPSERTED_V2 = 'card_upserted_v2' unless defined?(CARD_UPSERTED_V2)
4737
4746
  CARD_DELETED = 'card_deleted' unless defined?(CARD_DELETED)
4738
4747
  PAYMENT_UPSERTED = 'payment_upserted' unless defined?(PAYMENT_UPSERTED)
4739
4748
  PAYMENT_DELETED = 'payment_deleted' unless defined?(PAYMENT_DELETED)
4740
4749
  REFUND_UPSERTED = 'refund_upserted' unless defined?(REFUND_UPSERTED)
4750
+ REFUND_UPSERTED_V2 = 'refund_upserted_v2' unless defined?(REFUND_UPSERTED_V2)
4741
4751
  RETURN_UPSERTED = 'return_upserted' unless defined?(RETURN_UPSERTED)
4742
4752
  RETURN_DELETED = 'return_deleted' unless defined?(RETURN_DELETED)
4743
4753
  TARGETING_ITEM_UPSERTED = 'targeting_item_upserted' unless defined?(TARGETING_ITEM_UPSERTED)
@@ -4754,7 +4764,7 @@ module Io
4754
4764
  end
4755
4765
 
4756
4766
  def subtype_to_hash
4757
- 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, localized_item_upserted, localized_item_deleted, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, authorization_status_changed, card_authorization_upserted, online_authorization_upserted, capture_upserted, card_upserted, card_deleted, payment_upserted, payment_deleted, refund_upserted, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
4767
+ 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, localized_item_upserted, localized_item_deleted, 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, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
4758
4768
  end
4759
4769
 
4760
4770
  def to_hash
@@ -4822,15 +4832,21 @@ module Io
4822
4832
  when Types::ORGANIZATION_DELETED; OrganizationDeleted.new(hash)
4823
4833
  when Types::AUTHORIZATION_UPSERTED; AuthorizationUpserted.new(hash)
4824
4834
  when Types::AUTHORIZATION_DELETED; AuthorizationDeleted.new(hash)
4835
+ when Types::AUTHORIZATION_DELETED_V2; AuthorizationDeletedV2.new(hash)
4825
4836
  when Types::AUTHORIZATION_STATUS_CHANGED; AuthorizationStatusChanged.new(hash)
4826
4837
  when Types::CARD_AUTHORIZATION_UPSERTED; CardAuthorizationUpserted.new(hash)
4838
+ when Types::CARD_AUTHORIZATION_UPSERTED_V2; CardAuthorizationUpsertedV2.new(hash)
4827
4839
  when Types::ONLINE_AUTHORIZATION_UPSERTED; OnlineAuthorizationUpserted.new(hash)
4840
+ when Types::ONLINE_AUTHORIZATION_UPSERTED_V2; OnlineAuthorizationUpsertedV2.new(hash)
4828
4841
  when Types::CAPTURE_UPSERTED; CaptureUpserted.new(hash)
4842
+ when Types::CAPTURE_UPSERTED_V2; CaptureUpsertedV2.new(hash)
4829
4843
  when Types::CARD_UPSERTED; CardUpserted.new(hash)
4844
+ when Types::CARD_UPSERTED_V2; CardUpsertedV2.new(hash)
4830
4845
  when Types::CARD_DELETED; CardDeleted.new(hash)
4831
4846
  when Types::PAYMENT_UPSERTED; PaymentUpserted.new(hash)
4832
4847
  when Types::PAYMENT_DELETED; PaymentDeleted.new(hash)
4833
4848
  when Types::REFUND_UPSERTED; RefundUpserted.new(hash)
4849
+ when Types::REFUND_UPSERTED_V2; RefundUpsertedV2.new(hash)
4834
4850
  when Types::RETURN_UPSERTED; ReturnUpserted.new(hash)
4835
4851
  when Types::RETURN_DELETED; ReturnDeleted.new(hash)
4836
4852
  when Types::TARGETING_ITEM_UPSERTED; TargetingItemUpserted.new(hash)
@@ -5115,6 +5131,68 @@ module Io
5115
5131
 
5116
5132
  end
5117
5133
 
5134
+ class ExpandablePayment
5135
+
5136
+ module Types
5137
+ PAYMENT_PAYPAL = 'payment_paypal' unless defined?(PAYMENT_PAYPAL)
5138
+ PAYMENT_REFERENCE = 'payment_reference' unless defined?(PAYMENT_REFERENCE)
5139
+ end
5140
+
5141
+ attr_reader :discriminator
5142
+
5143
+ def initialize(incoming={})
5144
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5145
+ HttpClient::Preconditions.require_keys(opts, [:discriminator], 'ExpandablePayment')
5146
+ @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
5147
+ end
5148
+
5149
+ def subtype_to_hash
5150
+ raise 'Cannot serialize an instance of expandable_payment directly - must use one of the specific types: payment_paypal, payment_reference'
5151
+ end
5152
+
5153
+ def to_hash
5154
+ subtype_to_hash.merge(:discriminator => @discriminator)
5155
+ end
5156
+
5157
+ def ExpandablePayment.from_json(hash)
5158
+ HttpClient::Preconditions.assert_class('hash', hash, Hash)
5159
+ discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
5160
+ if discriminator.empty?
5161
+ raise "Union type[expandable_payment] requires a field named 'discriminator'"
5162
+ end
5163
+ case discriminator
5164
+ when Types::PAYMENT_PAYPAL; PaymentPaypal.new(hash)
5165
+ when Types::PAYMENT_REFERENCE; PaymentReference.new(hash)
5166
+ else ExpandablePaymentUndefinedType.new(:discriminator => discriminator)
5167
+ end
5168
+ end
5169
+
5170
+ end
5171
+
5172
+ class ExpandablePaymentUndefinedType < ExpandablePayment
5173
+
5174
+ attr_reader :name
5175
+
5176
+ def initialize(incoming={})
5177
+ super(:discriminator => 'undefined_type')
5178
+ opts = HttpClient::Helper.symbolize_keys(incoming)
5179
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
5180
+ end
5181
+
5182
+ def subtype_to_hash
5183
+ raise 'Unable to serialize undefined type to json'
5184
+ end
5185
+
5186
+ def copy(incoming={})
5187
+ raise 'Operation not supported for undefined type'
5188
+ end
5189
+
5190
+ def to_hash
5191
+ raise 'Operation not supported for undefined type'
5192
+ end
5193
+
5194
+ end
5195
+
5118
5196
  # A subcatalog can be represented with just it's ID, or the entire model
5119
5197
  class ExpandableSubcatalog
5120
5198
 
@@ -7180,7 +7258,7 @@ module Io
7180
7258
  end
7181
7259
 
7182
7260
  def EventType.ALL
7183
- @@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.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.authorization_status_changed, EventType.card_authorization_upserted, EventType.online_authorization_upserted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.payment_upserted, EventType.payment_deleted, EventType.refund_upserted, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
7261
+ @@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.localized_item_upserted, EventType.localized_item_deleted, 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.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
7184
7262
  end
7185
7263
 
7186
7264
  def EventType.attribute_upserted
@@ -7399,6 +7477,10 @@ module Io
7399
7477
  @@_authorization_deleted ||= EventType.new('authorization_deleted')
7400
7478
  end
7401
7479
 
7480
+ def EventType.authorization_deleted_v2
7481
+ @@_authorization_deleted_v2 ||= EventType.new('authorization_deleted_v2')
7482
+ end
7483
+
7402
7484
  def EventType.authorization_status_changed
7403
7485
  @@_authorization_status_changed ||= EventType.new('authorization_status_changed')
7404
7486
  end
@@ -7407,18 +7489,34 @@ module Io
7407
7489
  @@_card_authorization_upserted ||= EventType.new('card_authorization_upserted')
7408
7490
  end
7409
7491
 
7492
+ def EventType.card_authorization_upserted_v2
7493
+ @@_card_authorization_upserted_v2 ||= EventType.new('card_authorization_upserted_v2')
7494
+ end
7495
+
7410
7496
  def EventType.online_authorization_upserted
7411
7497
  @@_online_authorization_upserted ||= EventType.new('online_authorization_upserted')
7412
7498
  end
7413
7499
 
7500
+ def EventType.online_authorization_upserted_v2
7501
+ @@_online_authorization_upserted_v2 ||= EventType.new('online_authorization_upserted_v2')
7502
+ end
7503
+
7414
7504
  def EventType.capture_upserted
7415
7505
  @@_capture_upserted ||= EventType.new('capture_upserted')
7416
7506
  end
7417
7507
 
7508
+ def EventType.capture_upserted_v2
7509
+ @@_capture_upserted_v2 ||= EventType.new('capture_upserted_v2')
7510
+ end
7511
+
7418
7512
  def EventType.card_upserted
7419
7513
  @@_card_upserted ||= EventType.new('card_upserted')
7420
7514
  end
7421
7515
 
7516
+ def EventType.card_upserted_v2
7517
+ @@_card_upserted_v2 ||= EventType.new('card_upserted_v2')
7518
+ end
7519
+
7422
7520
  def EventType.card_deleted
7423
7521
  @@_card_deleted ||= EventType.new('card_deleted')
7424
7522
  end
@@ -7435,6 +7533,10 @@ module Io
7435
7533
  @@_refund_upserted ||= EventType.new('refund_upserted')
7436
7534
  end
7437
7535
 
7536
+ def EventType.refund_upserted_v2
7537
+ @@_refund_upserted_v2 ||= EventType.new('refund_upserted_v2')
7538
+ end
7539
+
7438
7540
  def EventType.return_upserted
7439
7541
  @@_return_upserted ||= EventType.new('return_upserted')
7440
7542
  end
@@ -10624,6 +10726,39 @@ module Io
10624
10726
 
10625
10727
  end
10626
10728
 
10729
+ class AuthorizationDeletedV2 < Event
10730
+
10731
+ attr_reader :event_id, :timestamp, :organization, :id
10732
+
10733
+ def initialize(incoming={})
10734
+ super(:discriminator => Event::Types::AUTHORIZATION_DELETED_V2)
10735
+ opts = HttpClient::Helper.symbolize_keys(incoming)
10736
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id], 'AuthorizationDeletedV2')
10737
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
10738
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
10739
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
10740
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
10741
+ end
10742
+
10743
+ def to_json
10744
+ JSON.dump(to_hash)
10745
+ end
10746
+
10747
+ def copy(incoming={})
10748
+ AuthorizationDeletedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10749
+ end
10750
+
10751
+ def subtype_to_hash
10752
+ {
10753
+ :event_id => event_id,
10754
+ :timestamp => timestamp,
10755
+ :organization => organization,
10756
+ :id => id
10757
+ }
10758
+ end
10759
+
10760
+ end
10761
+
10627
10762
  class AuthorizationOrderReference
10628
10763
 
10629
10764
  attr_reader :number
@@ -10652,12 +10787,13 @@ module Io
10652
10787
 
10653
10788
  class AuthorizationReference
10654
10789
 
10655
- attr_reader :id
10790
+ attr_reader :id, :key
10656
10791
 
10657
10792
  def initialize(incoming={})
10658
10793
  opts = HttpClient::Helper.symbolize_keys(incoming)
10659
- HttpClient::Preconditions.require_keys(opts, [:id], 'AuthorizationReference')
10794
+ HttpClient::Preconditions.require_keys(opts, [:id, :key], 'AuthorizationReference')
10660
10795
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
10796
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
10661
10797
  end
10662
10798
 
10663
10799
  def to_json
@@ -10670,7 +10806,8 @@ module Io
10670
10806
 
10671
10807
  def to_hash
10672
10808
  {
10673
- :id => id
10809
+ :id => id,
10810
+ :key => key
10674
10811
  }
10675
10812
  end
10676
10813
 
@@ -10973,7 +11110,7 @@ module Io
10973
11110
  # authorization otherwise becomes unavailable (e.g. expires).
10974
11111
  class Capture
10975
11112
 
10976
- attr_reader :id, :key, :authorization, :amount, :currency, :created_at
11113
+ attr_reader :id, :key, :authorization, :amount, :currency, :created_at, :attributes
10977
11114
 
10978
11115
  def initialize(incoming={})
10979
11116
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -10984,6 +11121,7 @@ module Io
10984
11121
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
10985
11122
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
10986
11123
  @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
11124
+ @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 })
10987
11125
  end
10988
11126
 
10989
11127
  def to_json
@@ -11001,7 +11139,8 @@ module Io
11001
11139
  :authorization => authorization.to_hash,
11002
11140
  :amount => amount,
11003
11141
  :currency => currency,
11004
- :created_at => created_at
11142
+ :created_at => created_at,
11143
+ :attributes => attributes.nil? ? nil : attributes
11005
11144
  }
11006
11145
  end
11007
11146
 
@@ -11012,7 +11151,7 @@ module Io
11012
11151
  # authorization otherwise becomes unavailable (e.g. expires).
11013
11152
  class CaptureForm
11014
11153
 
11015
- attr_reader :authorization_id, :key, :amount, :currency
11154
+ attr_reader :authorization_id, :key, :amount, :currency, :attributes
11016
11155
 
11017
11156
  def initialize(incoming={})
11018
11157
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -11021,6 +11160,7 @@ module Io
11021
11160
  @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
11022
11161
  @amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
11023
11162
  @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
11163
+ @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 })
11024
11164
  end
11025
11165
 
11026
11166
  def to_json
@@ -11036,7 +11176,8 @@ module Io
11036
11176
  :authorization_id => authorization_id,
11037
11177
  :key => key,
11038
11178
  :amount => amount,
11039
- :currency => currency
11179
+ :currency => currency,
11180
+ :attributes => attributes.nil? ? nil : attributes
11040
11181
  }
11041
11182
  end
11042
11183
 
@@ -11083,6 +11224,41 @@ module Io
11083
11224
 
11084
11225
  end
11085
11226
 
11227
+ class CaptureUpsertedV2 < Event
11228
+
11229
+ attr_reader :event_id, :timestamp, :organization, :id, :capture
11230
+
11231
+ def initialize(incoming={})
11232
+ super(:discriminator => Event::Types::CAPTURE_UPSERTED_V2)
11233
+ opts = HttpClient::Helper.symbolize_keys(incoming)
11234
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :capture], 'CaptureUpsertedV2')
11235
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
11236
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11237
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
11238
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11239
+ @capture = (x = opts.delete(:capture); x.is_a?(::Io::Flow::V0::Models::Capture) ? x : ::Io::Flow::V0::Models::Capture.new(x))
11240
+ end
11241
+
11242
+ def to_json
11243
+ JSON.dump(to_hash)
11244
+ end
11245
+
11246
+ def copy(incoming={})
11247
+ CaptureUpsertedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11248
+ end
11249
+
11250
+ def subtype_to_hash
11251
+ {
11252
+ :event_id => event_id,
11253
+ :timestamp => timestamp,
11254
+ :organization => organization,
11255
+ :id => id,
11256
+ :capture => capture.to_hash
11257
+ }
11258
+ end
11259
+
11260
+ end
11261
+
11086
11262
  class CaptureVersion
11087
11263
 
11088
11264
  attr_reader :id, :timestamp, :type, :capture
@@ -11250,6 +11426,42 @@ module Io
11250
11426
 
11251
11427
  end
11252
11428
 
11429
+ # Represents an authorization for a card payment method
11430
+ class CardAuthorizationUpsertedV2 < Event
11431
+
11432
+ attr_reader :event_id, :timestamp, :organization, :id, :authorization
11433
+
11434
+ def initialize(incoming={})
11435
+ super(:discriminator => Event::Types::CARD_AUTHORIZATION_UPSERTED_V2)
11436
+ opts = HttpClient::Helper.symbolize_keys(incoming)
11437
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :authorization], 'CardAuthorizationUpsertedV2')
11438
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
11439
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11440
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
11441
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11442
+ @authorization = (x = opts.delete(:authorization); x.is_a?(::Io::Flow::V0::Models::CardAuthorization) ? x : ::Io::Flow::V0::Models::CardAuthorization.new(x))
11443
+ end
11444
+
11445
+ def to_json
11446
+ JSON.dump(to_hash)
11447
+ end
11448
+
11449
+ def copy(incoming={})
11450
+ CardAuthorizationUpsertedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11451
+ end
11452
+
11453
+ def subtype_to_hash
11454
+ {
11455
+ :event_id => event_id,
11456
+ :timestamp => timestamp,
11457
+ :organization => organization,
11458
+ :id => id,
11459
+ :authorization => authorization.to_hash
11460
+ }
11461
+ end
11462
+
11463
+ end
11464
+
11253
11465
  class CardDeleted < Event
11254
11466
 
11255
11467
  attr_reader :event_id, :timestamp, :organization, :id
@@ -11462,6 +11674,41 @@ module Io
11462
11674
 
11463
11675
  end
11464
11676
 
11677
+ class CardUpsertedV2 < Event
11678
+
11679
+ attr_reader :event_id, :timestamp, :organization, :id, :card
11680
+
11681
+ def initialize(incoming={})
11682
+ super(:discriminator => Event::Types::CARD_UPSERTED_V2)
11683
+ opts = HttpClient::Helper.symbolize_keys(incoming)
11684
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :card], 'CardUpsertedV2')
11685
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
11686
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11687
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
11688
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11689
+ @card = (x = opts.delete(:card); x.is_a?(::Io::Flow::V0::Models::Card) ? x : ::Io::Flow::V0::Models::Card.new(x))
11690
+ end
11691
+
11692
+ def to_json
11693
+ JSON.dump(to_hash)
11694
+ end
11695
+
11696
+ def copy(incoming={})
11697
+ CardUpsertedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11698
+ end
11699
+
11700
+ def subtype_to_hash
11701
+ {
11702
+ :event_id => event_id,
11703
+ :timestamp => timestamp,
11704
+ :organization => organization,
11705
+ :id => id,
11706
+ :card => card.to_hash
11707
+ }
11708
+ end
11709
+
11710
+ end
11711
+
11465
11712
  class CardVersion
11466
11713
 
11467
11714
  attr_reader :id, :timestamp, :type, :card
@@ -17765,7 +18012,7 @@ module Io
17765
18012
  HttpClient::Preconditions.require_keys(opts, [:id, :key, :payment, :amount, :currency, :customer, :attributes, :result, :created_at], 'OnlineAuthorization')
17766
18013
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
17767
18014
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
17768
- @payment = (x = opts.delete(:payment); x.is_a?(::Io::Flow::V0::Models::PaymentReference) ? x : ::Io::Flow::V0::Models::PaymentReference.new(x))
18015
+ @payment = (x = opts.delete(:payment); x.is_a?(::Io::Flow::V0::Models::ExpandablePayment) ? x : ::Io::Flow::V0::Models::ExpandablePayment.from_json(x))
17769
18016
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
17770
18017
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
17771
18018
  @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
@@ -17838,6 +18085,42 @@ module Io
17838
18085
 
17839
18086
  end
17840
18087
 
18088
+ # Represents an authorization for a card payment method
18089
+ class OnlineAuthorizationUpsertedV2 < Event
18090
+
18091
+ attr_reader :event_id, :timestamp, :organization, :id, :authorization
18092
+
18093
+ def initialize(incoming={})
18094
+ super(:discriminator => Event::Types::ONLINE_AUTHORIZATION_UPSERTED_V2)
18095
+ opts = HttpClient::Helper.symbolize_keys(incoming)
18096
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :authorization], 'OnlineAuthorizationUpsertedV2')
18097
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
18098
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
18099
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
18100
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
18101
+ @authorization = (x = opts.delete(:authorization); x.is_a?(::Io::Flow::V0::Models::OnlineAuthorization) ? x : ::Io::Flow::V0::Models::OnlineAuthorization.new(x))
18102
+ end
18103
+
18104
+ def to_json
18105
+ JSON.dump(to_hash)
18106
+ end
18107
+
18108
+ def copy(incoming={})
18109
+ OnlineAuthorizationUpsertedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18110
+ end
18111
+
18112
+ def subtype_to_hash
18113
+ {
18114
+ :event_id => event_id,
18115
+ :timestamp => timestamp,
18116
+ :organization => organization,
18117
+ :id => id,
18118
+ :authorization => authorization.to_hash
18119
+ }
18120
+ end
18121
+
18122
+ end
18123
+
17841
18124
  class OptionWeightEstimates
17842
18125
 
17843
18126
  attr_reader :gravitational, :dimensional
@@ -19613,12 +19896,12 @@ module Io
19613
19896
  end
19614
19897
 
19615
19898
  # Represents on line payment
19616
- class PaymentPaypal < Payment
19899
+ class PaymentPaypal < ExpandablePayment
19617
19900
 
19618
19901
  attr_reader :id, :order, :amount, :currency, :paypal
19619
19902
 
19620
19903
  def initialize(incoming={})
19621
- super(:discriminator => Payment::Types::PAYMENT_PAYPAL)
19904
+ super(:discriminator => ExpandablePayment::Types::PAYMENT_PAYPAL)
19622
19905
  opts = HttpClient::Helper.symbolize_keys(incoming)
19623
19906
  HttpClient::Preconditions.require_keys(opts, [:id, :amount, :currency, :paypal], 'PaymentPaypal')
19624
19907
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
@@ -19675,11 +19958,12 @@ module Io
19675
19958
 
19676
19959
  end
19677
19960
 
19678
- class PaymentReference
19961
+ class PaymentReference < ExpandablePayment
19679
19962
 
19680
19963
  attr_reader :id
19681
19964
 
19682
19965
  def initialize(incoming={})
19966
+ super(:discriminator => ExpandablePayment::Types::PAYMENT_REFERENCE)
19683
19967
  opts = HttpClient::Helper.symbolize_keys(incoming)
19684
19968
  HttpClient::Preconditions.require_keys(opts, [:id], 'PaymentReference')
19685
19969
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
@@ -19690,10 +19974,10 @@ module Io
19690
19974
  end
19691
19975
 
19692
19976
  def copy(incoming={})
19693
- PaymentReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19977
+ PaymentReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19694
19978
  end
19695
19979
 
19696
- def to_hash
19980
+ def subtype_to_hash
19697
19981
  {
19698
19982
  :id => id
19699
19983
  }
@@ -20733,7 +21017,7 @@ module Io
20733
21017
  # execute the refund).
20734
21018
  class Refund
20735
21019
 
20736
- attr_reader :id, :key, :authorization, :amount, :currency, :captures, :created_at
21020
+ attr_reader :id, :key, :authorization, :amount, :currency, :captures, :created_at, :attributes
20737
21021
 
20738
21022
  def initialize(incoming={})
20739
21023
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -20745,6 +21029,7 @@ module Io
20745
21029
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
20746
21030
  @captures = HttpClient::Preconditions.assert_class('captures', opts.delete(:captures), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::RefundCapture) ? x : ::Io::Flow::V0::Models::RefundCapture.new(x)) }
20747
21031
  @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
21032
+ @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 })
20748
21033
  end
20749
21034
 
20750
21035
  def to_json
@@ -20763,7 +21048,8 @@ module Io
20763
21048
  :amount => amount,
20764
21049
  :currency => currency,
20765
21050
  :captures => captures.map { |o| o.to_hash },
20766
- :created_at => created_at
21051
+ :created_at => created_at,
21052
+ :attributes => attributes.nil? ? nil : attributes
20767
21053
  }
20768
21054
  end
20769
21055
 
@@ -20805,7 +21091,7 @@ module Io
20805
21091
  # order number (or all of them as long as they match).
20806
21092
  class RefundForm
20807
21093
 
20808
- attr_reader :authorization_id, :capture_id, :order_number, :key, :amount, :currency, :rma_key
21094
+ attr_reader :authorization_id, :capture_id, :order_number, :key, :amount, :currency, :rma_key, :attributes
20809
21095
 
20810
21096
  def initialize(incoming={})
20811
21097
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -20816,6 +21102,7 @@ module Io
20816
21102
  @amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
20817
21103
  @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
20818
21104
  @rma_key = (x = opts.delete(:rma_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('rma_key', x, String))
21105
+ @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 })
20819
21106
  end
20820
21107
 
20821
21108
  def to_json
@@ -20834,7 +21121,8 @@ module Io
20834
21121
  :key => key,
20835
21122
  :amount => amount,
20836
21123
  :currency => currency,
20837
- :rma_key => rma_key
21124
+ :rma_key => rma_key,
21125
+ :attributes => attributes.nil? ? nil : attributes
20838
21126
  }
20839
21127
  end
20840
21128
 
@@ -20954,6 +21242,41 @@ module Io
20954
21242
 
20955
21243
  end
20956
21244
 
21245
+ class RefundUpsertedV2 < Event
21246
+
21247
+ attr_reader :event_id, :timestamp, :organization, :id, :refund
21248
+
21249
+ def initialize(incoming={})
21250
+ super(:discriminator => Event::Types::REFUND_UPSERTED_V2)
21251
+ opts = HttpClient::Helper.symbolize_keys(incoming)
21252
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :refund], 'RefundUpsertedV2')
21253
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
21254
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
21255
+ @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
21256
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
21257
+ @refund = (x = opts.delete(:refund); x.is_a?(::Io::Flow::V0::Models::Refund) ? x : ::Io::Flow::V0::Models::Refund.new(x))
21258
+ end
21259
+
21260
+ def to_json
21261
+ JSON.dump(to_hash)
21262
+ end
21263
+
21264
+ def copy(incoming={})
21265
+ RefundUpsertedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
21266
+ end
21267
+
21268
+ def subtype_to_hash
21269
+ {
21270
+ :event_id => event_id,
21271
+ :timestamp => timestamp,
21272
+ :organization => organization,
21273
+ :id => id,
21274
+ :refund => refund.to_hash
21275
+ }
21276
+ end
21277
+
21278
+ end
21279
+
20957
21280
  class RefundVersion
20958
21281
 
20959
21282
  attr_reader :id, :timestamp, :type, :refund
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.10
4
+ version: 0.2.11
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-04-12 00:00:00.000000000 Z
11
+ date: 2017-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json