flowcommerce 0.0.79 → 0.0.80
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 +4 -4
- data/lib/flow_commerce/flow_api_v0_client.rb +83 -70
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd1f6e89cc49f8420420759cdf9708d59271b485
|
4
|
+
data.tar.gz: ce4bf8543b6cc1eeed0bc8c6b884b0e2bcf3dea9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e5e972b95a81146cff3c08aad994b924efd209e23021521a361224134ce17464bd36535e484b1922ec2aafe83176623aa474737c89ff74babdbc93a9fd93c96
|
7
|
+
data.tar.gz: e28e3926236d29f92febef526b18de25c2fe2d5eea944c75fe8d475917e5a7e1ed56121a6ca683aeaf5a0921faa41f2e11dd04119bed370509efed9095c07ab1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.1.77
|
3
|
-
# apidoc:0.11.
|
3
|
+
# apidoc:0.11.42 http://www.apidoc.me/flow/api/0.1.89/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.
|
28
|
+
USER_AGENT = 'apidoc:0.11.42 http://www.apidoc.me/flow/api/0.1.89/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.1.77' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -2172,6 +2172,14 @@ module Io
|
|
2172
2172
|
::Io::Flow::V0::Models::Refund.new(r)
|
2173
2173
|
end
|
2174
2174
|
|
2175
|
+
# Returns a refund order summary for the specified order.
|
2176
|
+
def get_summary_by_order_number(organization, order_number)
|
2177
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2178
|
+
HttpClient::Preconditions.assert_class('order_number', order_number, String)
|
2179
|
+
r = @client.request("/#{CGI.escape(organization)}/refunds/summary/#{CGI.escape(order_number)}").get
|
2180
|
+
::Io::Flow::V0::Models::RefundOrderSummary.new(r)
|
2181
|
+
end
|
2182
|
+
|
2175
2183
|
# Provides visibility into recent changes of each object, including deletion
|
2176
2184
|
def get_versions(organization, incoming={})
|
2177
2185
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
@@ -4033,8 +4041,6 @@ module Io
|
|
4033
4041
|
CATALOG_ITEM_DELETED = 'catalog_item_deleted' unless defined?(CATALOG_ITEM_DELETED)
|
4034
4042
|
SUBCATALOG_ITEM_UPSERTED = 'subcatalog_item_upserted' unless defined?(SUBCATALOG_ITEM_UPSERTED)
|
4035
4043
|
SUBCATALOG_ITEM_DELETED = 'subcatalog_item_deleted' unless defined?(SUBCATALOG_ITEM_DELETED)
|
4036
|
-
TARGETING_ITEM_UPSERTED = 'targeting_item_upserted' unless defined?(TARGETING_ITEM_UPSERTED)
|
4037
|
-
TARGETING_ITEM_DELETED = 'targeting_item_deleted' unless defined?(TARGETING_ITEM_DELETED)
|
4038
4044
|
FLOW_CURRENCY_SETTING_DELETED = 'flow_currency_setting_deleted' unless defined?(FLOW_CURRENCY_SETTING_DELETED)
|
4039
4045
|
FLOW_CURRENCY_SETTING_UPSERTED = 'flow_currency_setting_upserted' unless defined?(FLOW_CURRENCY_SETTING_UPSERTED)
|
4040
4046
|
RATE_DELETED = 'rate_deleted' unless defined?(RATE_DELETED)
|
@@ -4070,6 +4076,8 @@ module Io
|
|
4070
4076
|
CARD_UPSERTED = 'card_upserted' unless defined?(CARD_UPSERTED)
|
4071
4077
|
CARD_DELETED = 'card_deleted' unless defined?(CARD_DELETED)
|
4072
4078
|
REFUND_UPSERTED = 'refund_upserted' unless defined?(REFUND_UPSERTED)
|
4079
|
+
TARGETING_ITEM_UPSERTED = 'targeting_item_upserted' unless defined?(TARGETING_ITEM_UPSERTED)
|
4080
|
+
TARGETING_ITEM_DELETED = 'targeting_item_deleted' unless defined?(TARGETING_ITEM_DELETED)
|
4073
4081
|
TRACKING_LABEL_EVENT_UPSERTED = 'tracking_label_event_upserted' unless defined?(TRACKING_LABEL_EVENT_UPSERTED)
|
4074
4082
|
end
|
4075
4083
|
|
@@ -4094,8 +4102,6 @@ module Io
|
|
4094
4102
|
when Types::CATALOG_ITEM_DELETED; CatalogItemDeleted.new(hash)
|
4095
4103
|
when Types::SUBCATALOG_ITEM_UPSERTED; SubcatalogItemUpserted.new(hash)
|
4096
4104
|
when Types::SUBCATALOG_ITEM_DELETED; SubcatalogItemDeleted.new(hash)
|
4097
|
-
when Types::TARGETING_ITEM_UPSERTED; TargetingItemUpserted.new(hash)
|
4098
|
-
when Types::TARGETING_ITEM_DELETED; TargetingItemDeleted.new(hash)
|
4099
4105
|
when Types::FLOW_CURRENCY_SETTING_DELETED; FlowCurrencySettingDeleted.new(hash)
|
4100
4106
|
when Types::FLOW_CURRENCY_SETTING_UPSERTED; FlowCurrencySettingUpserted.new(hash)
|
4101
4107
|
when Types::RATE_DELETED; RateDeleted.new(hash)
|
@@ -4131,6 +4137,8 @@ module Io
|
|
4131
4137
|
when Types::CARD_UPSERTED; CardUpserted.new(hash)
|
4132
4138
|
when Types::CARD_DELETED; CardDeleted.new(hash)
|
4133
4139
|
when Types::REFUND_UPSERTED; RefundUpserted.new(hash)
|
4140
|
+
when Types::TARGETING_ITEM_UPSERTED; TargetingItemUpserted.new(hash)
|
4141
|
+
when Types::TARGETING_ITEM_DELETED; TargetingItemDeleted.new(hash)
|
4134
4142
|
when Types::TRACKING_LABEL_EVENT_UPSERTED; TrackingLabelEventUpserted.new(hash)
|
4135
4143
|
else EventUndefinedType.new(:name => union_type_name)
|
4136
4144
|
end
|
@@ -5283,7 +5291,7 @@ module Io
|
|
5283
5291
|
end
|
5284
5292
|
|
5285
5293
|
def EventType.ALL
|
5286
|
-
@@all ||= [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.
|
5294
|
+
@@all ||= [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.flow_currency_setting_deleted, EventType.flow_currency_setting_upserted, EventType.rate_deleted, EventType.rate_upserted, EventType.spot_rate_deleted, EventType.spot_rate_upserted, EventType.organization_currency_setting_deleted, EventType.organization_currency_setting_upserted, EventType.contracted_rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_booking_deleted, EventType.order_booking_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.refund_upserted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
|
5287
5295
|
end
|
5288
5296
|
|
5289
5297
|
def EventType.catalog_upserted
|
@@ -5318,14 +5326,6 @@ module Io
|
|
5318
5326
|
@@_subcatalog_item_deleted ||= EventType.new('subcatalog_item_deleted')
|
5319
5327
|
end
|
5320
5328
|
|
5321
|
-
def EventType.targeting_item_upserted
|
5322
|
-
@@_targeting_item_upserted ||= EventType.new('targeting_item_upserted')
|
5323
|
-
end
|
5324
|
-
|
5325
|
-
def EventType.targeting_item_deleted
|
5326
|
-
@@_targeting_item_deleted ||= EventType.new('targeting_item_deleted')
|
5327
|
-
end
|
5328
|
-
|
5329
5329
|
def EventType.flow_currency_setting_deleted
|
5330
5330
|
@@_flow_currency_setting_deleted ||= EventType.new('flow_currency_setting_deleted')
|
5331
5331
|
end
|
@@ -5466,6 +5466,14 @@ module Io
|
|
5466
5466
|
@@_refund_upserted ||= EventType.new('refund_upserted')
|
5467
5467
|
end
|
5468
5468
|
|
5469
|
+
def EventType.targeting_item_upserted
|
5470
|
+
@@_targeting_item_upserted ||= EventType.new('targeting_item_upserted')
|
5471
|
+
end
|
5472
|
+
|
5473
|
+
def EventType.targeting_item_deleted
|
5474
|
+
@@_targeting_item_deleted ||= EventType.new('targeting_item_deleted')
|
5475
|
+
end
|
5476
|
+
|
5469
5477
|
def EventType.tracking_label_event_upserted
|
5470
5478
|
@@_tracking_label_event_upserted ||= EventType.new('tracking_label_event_upserted')
|
5471
5479
|
end
|
@@ -8207,13 +8215,13 @@ module Io
|
|
8207
8215
|
|
8208
8216
|
def initialize(incoming={})
|
8209
8217
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8210
|
-
HttpClient::Preconditions.require_keys(opts, [:expiration_month, :expiration_year, :name], 'CardForm')
|
8218
|
+
HttpClient::Preconditions.require_keys(opts, [:expiration_month, :expiration_year, :name, :cvv], 'CardForm')
|
8211
8219
|
@number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String))
|
8212
8220
|
@cipher = (x = opts.delete(:cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('cipher', x, String))
|
8213
8221
|
@expiration_month = HttpClient::Preconditions.assert_class('expiration_month', opts.delete(:expiration_month), Integer)
|
8214
8222
|
@expiration_year = HttpClient::Preconditions.assert_class('expiration_year', opts.delete(:expiration_year), Integer)
|
8215
8223
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
8216
|
-
@cvv =
|
8224
|
+
@cvv = HttpClient::Preconditions.assert_class('cvv', opts.delete(:cvv), String)
|
8217
8225
|
@address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
|
8218
8226
|
@challenge_text = (x = opts.delete(:challenge_text); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_text', x, String))
|
8219
8227
|
@challenge_cipher = (x = opts.delete(:challenge_cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_cipher', x, String))
|
@@ -13604,7 +13612,7 @@ module Io
|
|
13604
13612
|
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
13605
13613
|
@deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Delivery) ? x : ::Io::Flow::V0::Models::Delivery.new(x)) }
|
13606
13614
|
@selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
|
13607
|
-
@prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::
|
13615
|
+
@prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x)) }
|
13608
13616
|
@total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x))
|
13609
13617
|
@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 }
|
13610
13618
|
end
|
@@ -13906,15 +13914,16 @@ module Io
|
|
13906
13914
|
# Represents a top-level order price detail, e.g. 'Subtotal' or 'VAT'.
|
13907
13915
|
class OrderPriceDetail
|
13908
13916
|
|
13909
|
-
attr_reader :key, :currency, :amount, :label, :components
|
13917
|
+
attr_reader :key, :currency, :amount, :label, :base, :components
|
13910
13918
|
|
13911
13919
|
def initialize(incoming={})
|
13912
13920
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13913
|
-
HttpClient::Preconditions.require_keys(opts, [:key, :currency, :amount, :label, :components], 'OrderPriceDetail')
|
13921
|
+
HttpClient::Preconditions.require_keys(opts, [:key, :currency, :amount, :label, :base, :components], 'OrderPriceDetail')
|
13914
13922
|
@key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailKey.apply(x))
|
13915
13923
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
13916
|
-
@amount = HttpClient::Preconditions.assert_class('amount', opts.delete(:amount),
|
13924
|
+
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
13917
13925
|
@label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String)
|
13926
|
+
@base = (x = opts.delete(:base); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
13918
13927
|
@components = HttpClient::Preconditions.assert_class('components', opts.delete(:components), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailComponent) ? x : ::Io::Flow::V0::Models::OrderPriceDetailComponent.new(x)) }
|
13919
13928
|
end
|
13920
13929
|
|
@@ -13932,6 +13941,7 @@ module Io
|
|
13932
13941
|
:currency => currency,
|
13933
13942
|
:amount => amount,
|
13934
13943
|
:label => label,
|
13944
|
+
:base => base.to_hash,
|
13935
13945
|
:components => components.map { |o| o.to_hash }
|
13936
13946
|
}
|
13937
13947
|
end
|
@@ -13947,7 +13957,7 @@ module Io
|
|
13947
13957
|
HttpClient::Preconditions.require_keys(opts, [:key, :currency, :amount, :label, :base], 'OrderPriceDetailComponent')
|
13948
13958
|
@key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailComponentKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailComponentKey.apply(x))
|
13949
13959
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
13950
|
-
@amount = HttpClient::Preconditions.assert_class('amount', opts.delete(:amount),
|
13960
|
+
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
13951
13961
|
@label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String)
|
13952
13962
|
@base = (x = opts.delete(:base); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
|
13953
13963
|
end
|
@@ -13972,47 +13982,6 @@ module Io
|
|
13972
13982
|
|
13973
13983
|
end
|
13974
13984
|
|
13975
|
-
# Represents the price details for the entire order.
|
13976
|
-
class OrderPriceDetails
|
13977
|
-
|
13978
|
-
attr_reader :subtotal, :vat, :duty, :shipping, :insurance, :discounts, :adjustments, :total
|
13979
|
-
|
13980
|
-
def initialize(incoming={})
|
13981
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
13982
|
-
HttpClient::Preconditions.require_keys(opts, [:subtotal, :vat, :duty, :shipping, :insurance, :discounts, :adjustments, :total], 'OrderPriceDetails')
|
13983
|
-
@subtotal = (x = opts.delete(:subtotal); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x))
|
13984
|
-
@vat = (x = opts.delete(:vat); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x))
|
13985
|
-
@duty = (x = opts.delete(:duty); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x))
|
13986
|
-
@shipping = (x = opts.delete(:shipping); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x))
|
13987
|
-
@insurance = (x = opts.delete(:insurance); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x))
|
13988
|
-
@discounts = (x = opts.delete(:discounts); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x))
|
13989
|
-
@adjustments = (x = opts.delete(:adjustments); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x))
|
13990
|
-
@total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
|
13991
|
-
end
|
13992
|
-
|
13993
|
-
def to_json
|
13994
|
-
JSON.dump(to_hash)
|
13995
|
-
end
|
13996
|
-
|
13997
|
-
def copy(incoming={})
|
13998
|
-
OrderPriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
13999
|
-
end
|
14000
|
-
|
14001
|
-
def to_hash
|
14002
|
-
{
|
14003
|
-
:subtotal => subtotal.to_hash,
|
14004
|
-
:vat => vat.to_hash,
|
14005
|
-
:duty => duty.to_hash,
|
14006
|
-
:shipping => shipping.to_hash,
|
14007
|
-
:insurance => insurance.to_hash,
|
14008
|
-
:discounts => discounts.to_hash,
|
14009
|
-
:adjustments => adjustments.to_hash,
|
14010
|
-
:total => total.to_hash
|
14011
|
-
}
|
14012
|
-
end
|
14013
|
-
|
14014
|
-
end
|
14015
|
-
|
14016
13985
|
# The order put form is used to upsert an order, providing the details on
|
14017
13986
|
# pricing and delivery options for destination and items/quantities specified.
|
14018
13987
|
class OrderPutForm
|
@@ -15605,16 +15574,17 @@ module Io
|
|
15605
15574
|
|
15606
15575
|
# Refund actually transfers funds. You can refund as many times as you'd like up
|
15607
15576
|
# until the total amount of captured funds has been refunded. Note when creating
|
15608
|
-
# a refund you can specify either an authorization id
|
15609
|
-
# as long as they match).
|
15577
|
+
# a refund you can specify either an order authorization id, a capture id, or an
|
15578
|
+
# order number (or all of them as long as they match).
|
15610
15579
|
class RefundForm
|
15611
15580
|
|
15612
|
-
attr_reader :authorization_id, :capture_id, :key, :amount, :currency
|
15581
|
+
attr_reader :authorization_id, :capture_id, :order_number, :key, :amount, :currency
|
15613
15582
|
|
15614
15583
|
def initialize(incoming={})
|
15615
15584
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
15616
15585
|
@authorization_id = (x = opts.delete(:authorization_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_id', x, String))
|
15617
15586
|
@capture_id = (x = opts.delete(:capture_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('capture_id', x, String))
|
15587
|
+
@order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
|
15618
15588
|
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
15619
15589
|
@amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
15620
15590
|
@currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
@@ -15632,6 +15602,7 @@ module Io
|
|
15632
15602
|
{
|
15633
15603
|
:authorization_id => authorization_id,
|
15634
15604
|
:capture_id => capture_id,
|
15605
|
+
:order_number => order_number,
|
15635
15606
|
:key => key,
|
15636
15607
|
:amount => amount,
|
15637
15608
|
:currency => currency
|
@@ -15640,6 +15611,44 @@ module Io
|
|
15640
15611
|
|
15641
15612
|
end
|
15642
15613
|
|
15614
|
+
# For merchant of record authorizations, we provide a summary of refund
|
15615
|
+
# information primarily to support customer service workflow.
|
15616
|
+
class RefundOrderSummary
|
15617
|
+
|
15618
|
+
attr_reader :order_number, :currency, :captured, :refunded, :available_to_refund, :shipping
|
15619
|
+
|
15620
|
+
def initialize(incoming={})
|
15621
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
15622
|
+
HttpClient::Preconditions.require_keys(opts, [:order_number, :currency, :captured, :refunded, :available_to_refund, :shipping], 'RefundOrderSummary')
|
15623
|
+
@order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
|
15624
|
+
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
15625
|
+
@captured = HttpClient::Preconditions.assert_class('captured', HttpClient::Helper.to_big_decimal(opts.delete(:captured)), BigDecimal)
|
15626
|
+
@refunded = HttpClient::Preconditions.assert_class('refunded', HttpClient::Helper.to_big_decimal(opts.delete(:refunded)), BigDecimal)
|
15627
|
+
@available_to_refund = HttpClient::Preconditions.assert_class('available_to_refund', HttpClient::Helper.to_big_decimal(opts.delete(:available_to_refund)), BigDecimal)
|
15628
|
+
@shipping = HttpClient::Preconditions.assert_class('shipping', HttpClient::Helper.to_big_decimal(opts.delete(:shipping)), BigDecimal)
|
15629
|
+
end
|
15630
|
+
|
15631
|
+
def to_json
|
15632
|
+
JSON.dump(to_hash)
|
15633
|
+
end
|
15634
|
+
|
15635
|
+
def copy(incoming={})
|
15636
|
+
RefundOrderSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
15637
|
+
end
|
15638
|
+
|
15639
|
+
def to_hash
|
15640
|
+
{
|
15641
|
+
:order_number => order_number,
|
15642
|
+
:currency => currency,
|
15643
|
+
:captured => captured,
|
15644
|
+
:refunded => refunded,
|
15645
|
+
:available_to_refund => available_to_refund,
|
15646
|
+
:shipping => shipping
|
15647
|
+
}
|
15648
|
+
end
|
15649
|
+
|
15650
|
+
end
|
15651
|
+
|
15643
15652
|
class RefundUpserted < Event
|
15644
15653
|
|
15645
15654
|
attr_reader :event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency, :captures, :created_at
|
@@ -17075,12 +17084,12 @@ module Io
|
|
17075
17084
|
|
17076
17085
|
class TargetingItemDeleted < Event
|
17077
17086
|
|
17078
|
-
attr_reader :event_id, :timestamp, :organization, :item_number, :q, :outcome_id, :catalog_id, :subcatalog_id
|
17087
|
+
attr_reader :event_id, :timestamp, :organization, :item_number, :q, :outcome_id, :catalog_id, :key, :subcatalog_id
|
17079
17088
|
|
17080
17089
|
def initialize(incoming={})
|
17081
17090
|
super(:name => Event::Types::TARGETING_ITEM_DELETED)
|
17082
17091
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
17083
|
-
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :item_number, :q, :outcome_id, :catalog_id], 'TargetingItemDeleted')
|
17092
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :item_number, :q, :outcome_id, :catalog_id, :key], 'TargetingItemDeleted')
|
17084
17093
|
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
17085
17094
|
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
17086
17095
|
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
@@ -17088,6 +17097,7 @@ module Io
|
|
17088
17097
|
@q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
|
17089
17098
|
@outcome_id = HttpClient::Preconditions.assert_class('outcome_id', opts.delete(:outcome_id), String)
|
17090
17099
|
@catalog_id = HttpClient::Preconditions.assert_class('catalog_id', opts.delete(:catalog_id), String)
|
17100
|
+
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
17091
17101
|
@subcatalog_id = (x = opts.delete(:subcatalog_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog_id', x, String))
|
17092
17102
|
end
|
17093
17103
|
|
@@ -17108,6 +17118,7 @@ module Io
|
|
17108
17118
|
:q => q,
|
17109
17119
|
:outcome_id => outcome_id,
|
17110
17120
|
:catalog_id => catalog_id,
|
17121
|
+
:key => key,
|
17111
17122
|
:subcatalog_id => subcatalog_id
|
17112
17123
|
}
|
17113
17124
|
end
|
@@ -17116,12 +17127,12 @@ module Io
|
|
17116
17127
|
|
17117
17128
|
class TargetingItemUpserted < Event
|
17118
17129
|
|
17119
|
-
attr_reader :event_id, :timestamp, :organization, :item_number, :q, :outcome_id, :catalog_id, :subcatalog_id
|
17130
|
+
attr_reader :event_id, :timestamp, :organization, :item_number, :q, :outcome_id, :catalog_id, :key, :subcatalog_id
|
17120
17131
|
|
17121
17132
|
def initialize(incoming={})
|
17122
17133
|
super(:name => Event::Types::TARGETING_ITEM_UPSERTED)
|
17123
17134
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
17124
|
-
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :item_number, :q, :outcome_id, :catalog_id], 'TargetingItemUpserted')
|
17135
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :item_number, :q, :outcome_id, :catalog_id, :key], 'TargetingItemUpserted')
|
17125
17136
|
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
17126
17137
|
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
17127
17138
|
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
@@ -17129,6 +17140,7 @@ module Io
|
|
17129
17140
|
@q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
|
17130
17141
|
@outcome_id = HttpClient::Preconditions.assert_class('outcome_id', opts.delete(:outcome_id), String)
|
17131
17142
|
@catalog_id = HttpClient::Preconditions.assert_class('catalog_id', opts.delete(:catalog_id), String)
|
17143
|
+
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
17132
17144
|
@subcatalog_id = (x = opts.delete(:subcatalog_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog_id', x, String))
|
17133
17145
|
end
|
17134
17146
|
|
@@ -17149,6 +17161,7 @@ module Io
|
|
17149
17161
|
:q => q,
|
17150
17162
|
:outcome_id => outcome_id,
|
17151
17163
|
:catalog_id => catalog_id,
|
17164
|
+
:key => key,
|
17152
17165
|
:subcatalog_id => subcatalog_id
|
17153
17166
|
}
|
17154
17167
|
end
|
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.0.
|
4
|
+
version: 0.0.80
|
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: 2016-10-
|
11
|
+
date: 2016-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|