flowcommerce 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flow_commerce/flow_api_v0_client.rb +137 -19
- 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: d5a6d0ad9659227acb66e84748101e6d2708d29f
|
4
|
+
data.tar.gz: 54f53d13519d2d302b629bd2aef9e7c895777e26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae1c30bf8c654f5e1dc3ed8ea88d3aaa8f88da081b72b6153b6bfb1aabc0ee5bfb01e2372ae9e0275953f139e8830fb99b600f6f490c18244ac3dea84e7f229a
|
7
|
+
data.tar.gz: 9443beb11f424c01f71b8f38952899c083c27f969354bf3562e89583f1fa3496095d214b15cacfd662e6f3fdee61d333dacca3bbe1cd713e9208700ef4d6684b
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.1.77
|
3
|
-
# apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.
|
3
|
+
# apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.17/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.49 http://www.apidoc.me/flow/api/0.2.
|
28
|
+
USER_AGENT = 'apidoc:0.11.49 http://www.apidoc.me/flow/api/0.2.17/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
|
|
@@ -597,7 +597,7 @@ module Io
|
|
597
597
|
|
598
598
|
# Formats the requested amount using the formatting settings for the
|
599
599
|
# experience.
|
600
|
-
def
|
600
|
+
def get_conversions_by_base_and_amount(organization, base, amount, incoming={})
|
601
601
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
602
602
|
HttpClient::Preconditions.assert_class('base', base, String)
|
603
603
|
HttpClient::Preconditions.assert_class('amount', amount, String)
|
@@ -608,7 +608,7 @@ module Io
|
|
608
608
|
:ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
|
609
609
|
:currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
610
610
|
}.delete_if { |k, v| v.nil? }
|
611
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/
|
611
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/conversions/#{CGI.escape(base)}/#{CGI.escape(amount)}").with_query(query).get
|
612
612
|
::Io::Flow::V0::Models::PriceWithBase.new(r)
|
613
613
|
end
|
614
614
|
|
@@ -5017,7 +5017,7 @@ module Io
|
|
5017
5017
|
end
|
5018
5018
|
|
5019
5019
|
def AdjustmentReasonKey.ALL
|
5020
|
-
@@all ||= [AdjustmentReasonKey.duty_deminimis, AdjustmentReasonKey.
|
5020
|
+
@@all ||= [AdjustmentReasonKey.duty_deminimis, AdjustmentReasonKey.vat_deminimis]
|
5021
5021
|
end
|
5022
5022
|
|
5023
5023
|
# If the duty de minimis value has not been met, an adjustment may be made to
|
@@ -5026,10 +5026,10 @@ module Io
|
|
5026
5026
|
@@_duty_deminimis ||= AdjustmentReasonKey.new('duty_deminimis')
|
5027
5027
|
end
|
5028
5028
|
|
5029
|
-
# If the
|
5030
|
-
# offset any previously calculated
|
5031
|
-
def AdjustmentReasonKey.
|
5032
|
-
@@
|
5029
|
+
# If the VAT de minimis value has not been met, an adjustment may be made to
|
5030
|
+
# offset any previously calculated VAT.
|
5031
|
+
def AdjustmentReasonKey.vat_deminimis
|
5032
|
+
@@_vat_deminimis ||= AdjustmentReasonKey.new('vat_deminimis')
|
5033
5033
|
end
|
5034
5034
|
|
5035
5035
|
def to_hash
|
@@ -5128,6 +5128,55 @@ module Io
|
|
5128
5128
|
|
5129
5129
|
end
|
5130
5130
|
|
5131
|
+
class AuthorizationDeleteErrorCode
|
5132
|
+
|
5133
|
+
attr_reader :value
|
5134
|
+
|
5135
|
+
def initialize(value)
|
5136
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
5137
|
+
end
|
5138
|
+
|
5139
|
+
# Returns the instance of AuthorizationDeleteErrorCode for this value, creating a new instance for an unknown value
|
5140
|
+
def AuthorizationDeleteErrorCode.apply(value)
|
5141
|
+
if value.instance_of?(AuthorizationDeleteErrorCode)
|
5142
|
+
value
|
5143
|
+
else
|
5144
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
5145
|
+
value.nil? ? nil : (from_string(value) || AuthorizationDeleteErrorCode.new(value))
|
5146
|
+
end
|
5147
|
+
end
|
5148
|
+
|
5149
|
+
# Returns the instance of AuthorizationDeleteErrorCode for this value, or nil if not found
|
5150
|
+
def AuthorizationDeleteErrorCode.from_string(value)
|
5151
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
5152
|
+
AuthorizationDeleteErrorCode.ALL.find { |v| v.value == value }
|
5153
|
+
end
|
5154
|
+
|
5155
|
+
def AuthorizationDeleteErrorCode.ALL
|
5156
|
+
@@all ||= [AuthorizationDeleteErrorCode.expired, AuthorizationDeleteErrorCode.captured, AuthorizationDeleteErrorCode.unknown]
|
5157
|
+
end
|
5158
|
+
|
5159
|
+
# Payment authorization has expired
|
5160
|
+
def AuthorizationDeleteErrorCode.expired
|
5161
|
+
@@_expired ||= AuthorizationDeleteErrorCode.new('expired')
|
5162
|
+
end
|
5163
|
+
|
5164
|
+
# Payment authorization has already been captured. Please create a refund.
|
5165
|
+
def AuthorizationDeleteErrorCode.captured
|
5166
|
+
@@_captured ||= AuthorizationDeleteErrorCode.new('captured')
|
5167
|
+
end
|
5168
|
+
|
5169
|
+
# Failed due to another reason (details not known)
|
5170
|
+
def AuthorizationDeleteErrorCode.unknown
|
5171
|
+
@@_unknown ||= AuthorizationDeleteErrorCode.new('unknown')
|
5172
|
+
end
|
5173
|
+
|
5174
|
+
def to_hash
|
5175
|
+
value
|
5176
|
+
end
|
5177
|
+
|
5178
|
+
end
|
5179
|
+
|
5131
5180
|
class AuthorizationStatus
|
5132
5181
|
|
5133
5182
|
attr_reader :value
|
@@ -6551,7 +6600,7 @@ module Io
|
|
6551
6600
|
end
|
6552
6601
|
|
6553
6602
|
def OrderPriceDetailComponentKey.ALL
|
6554
|
-
@@all ||= [OrderPriceDetailComponentKey.adjustment, OrderPriceDetailComponentKey.
|
6603
|
+
@@all ||= [OrderPriceDetailComponentKey.adjustment, OrderPriceDetailComponentKey.vat_deminimis, OrderPriceDetailComponentKey.duty_deminimis, OrderPriceDetailComponentKey.duties_item_price, OrderPriceDetailComponentKey.duties_freight, OrderPriceDetailComponentKey.duties_insurance, OrderPriceDetailComponentKey.vat_item_price, OrderPriceDetailComponentKey.vat_freight, OrderPriceDetailComponentKey.vat_insurance, OrderPriceDetailComponentKey.vat_duties_item_price, OrderPriceDetailComponentKey.vat_duties_freight, OrderPriceDetailComponentKey.vat_duties_insurance, OrderPriceDetailComponentKey.item_price, OrderPriceDetailComponentKey.rounding, OrderPriceDetailComponentKey.insurance, OrderPriceDetailComponentKey.shipping, OrderPriceDetailComponentKey.order_discount]
|
6555
6604
|
end
|
6556
6605
|
|
6557
6606
|
# A general purpose adjustment applied to the order.
|
@@ -6559,9 +6608,9 @@ module Io
|
|
6559
6608
|
@@_adjustment ||= OrderPriceDetailComponentKey.new('adjustment')
|
6560
6609
|
end
|
6561
6610
|
|
6562
|
-
# An adjustment based on whether the
|
6563
|
-
def OrderPriceDetailComponentKey.
|
6564
|
-
@@
|
6611
|
+
# An adjustment based on whether the VAT de minimis applies to the order.
|
6612
|
+
def OrderPriceDetailComponentKey.vat_deminimis
|
6613
|
+
@@_vat_deminimis ||= OrderPriceDetailComponentKey.new('vat_deminimis')
|
6565
6614
|
end
|
6566
6615
|
|
6567
6616
|
# An adjustment based on whether the duty de minimis applies to the order.
|
@@ -8294,6 +8343,34 @@ module Io
|
|
8294
8343
|
|
8295
8344
|
end
|
8296
8345
|
|
8346
|
+
class AuthorizationDeleteError
|
8347
|
+
|
8348
|
+
attr_reader :code, :messages
|
8349
|
+
|
8350
|
+
def initialize(incoming={})
|
8351
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
8352
|
+
HttpClient::Preconditions.require_keys(opts, [:code, :messages], 'AuthorizationDeleteError')
|
8353
|
+
@code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::AuthorizationDeleteErrorCode) ? x : ::Io::Flow::V0::Models::AuthorizationDeleteErrorCode.apply(x))
|
8354
|
+
@messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
|
8355
|
+
end
|
8356
|
+
|
8357
|
+
def to_json
|
8358
|
+
JSON.dump(to_hash)
|
8359
|
+
end
|
8360
|
+
|
8361
|
+
def copy(incoming={})
|
8362
|
+
AuthorizationDeleteError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
8363
|
+
end
|
8364
|
+
|
8365
|
+
def to_hash
|
8366
|
+
{
|
8367
|
+
:code => code.value,
|
8368
|
+
:messages => messages
|
8369
|
+
}
|
8370
|
+
end
|
8371
|
+
|
8372
|
+
end
|
8373
|
+
|
8297
8374
|
class AuthorizationDeleted < Event
|
8298
8375
|
|
8299
8376
|
attr_reader :event_id, :timestamp, :organization, :key
|
@@ -10314,11 +10391,11 @@ module Io
|
|
10314
10391
|
def initialize(incoming={})
|
10315
10392
|
super(:name => Deminimis::Types::DEMINIMIS_SIMPLE)
|
10316
10393
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
10317
|
-
HttpClient::Preconditions.require_keys(opts, [:
|
10318
|
-
@value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(
|
10394
|
+
HttpClient::Preconditions.require_keys(opts, [:currency, :components], 'DeminimisSimple')
|
10395
|
+
@value = (x = opts.delete(:value); x.nil? ? nil : HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
10319
10396
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
10320
10397
|
@components = HttpClient::Preconditions.assert_class('components', opts.delete(:components), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LevyComponent) ? x : ::Io::Flow::V0::Models::LevyComponent.apply(x)) }
|
10321
|
-
@minimum = HttpClient::Preconditions.assert_class('minimum', HttpClient::Helper.to_big_decimal(
|
10398
|
+
@minimum = (x = opts.delete(:minimum); x.nil? ? nil : HttpClient::Preconditions.assert_class('minimum', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
10322
10399
|
end
|
10323
10400
|
|
10324
10401
|
def to_json
|
@@ -14446,7 +14523,7 @@ module Io
|
|
14446
14523
|
@customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
|
14447
14524
|
@expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime)
|
14448
14525
|
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedLineItem) ? x : ::Io::Flow::V0::Models::LocalizedLineItem.new(x)) }
|
14449
|
-
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::
|
14526
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
|
14450
14527
|
@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)) }
|
14451
14528
|
@selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
|
14452
14529
|
@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)) }
|
@@ -14480,6 +14557,47 @@ module Io
|
|
14480
14557
|
|
14481
14558
|
end
|
14482
14559
|
|
14560
|
+
class OrderAddress
|
14561
|
+
|
14562
|
+
attr_reader :text, :streets, :city, :province, :postal, :country, :latitude, :longitude, :contact
|
14563
|
+
|
14564
|
+
def initialize(incoming={})
|
14565
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14566
|
+
@text = (x = opts.delete(:text); x.nil? ? nil : HttpClient::Preconditions.assert_class('text', x, String))
|
14567
|
+
@streets = (x = opts.delete(:streets); x.nil? ? nil : HttpClient::Preconditions.assert_class('streets', x, Array).map { |v| HttpClient::Preconditions.assert_class('streets', v, String) })
|
14568
|
+
@city = (x = opts.delete(:city); x.nil? ? nil : HttpClient::Preconditions.assert_class('city', x, String))
|
14569
|
+
@province = (x = opts.delete(:province); x.nil? ? nil : HttpClient::Preconditions.assert_class('province', x, String))
|
14570
|
+
@postal = (x = opts.delete(:postal); x.nil? ? nil : HttpClient::Preconditions.assert_class('postal', x, String))
|
14571
|
+
@country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
|
14572
|
+
@latitude = (x = opts.delete(:latitude); x.nil? ? nil : HttpClient::Preconditions.assert_class('latitude', x, String))
|
14573
|
+
@longitude = (x = opts.delete(:longitude); x.nil? ? nil : HttpClient::Preconditions.assert_class('longitude', x, String))
|
14574
|
+
@contact = (x = opts.delete(:contact); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Contact) ? x : ::Io::Flow::V0::Models::Contact.new(x)))
|
14575
|
+
end
|
14576
|
+
|
14577
|
+
def to_json
|
14578
|
+
JSON.dump(to_hash)
|
14579
|
+
end
|
14580
|
+
|
14581
|
+
def copy(incoming={})
|
14582
|
+
OrderAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
14583
|
+
end
|
14584
|
+
|
14585
|
+
def to_hash
|
14586
|
+
{
|
14587
|
+
:text => text,
|
14588
|
+
:streets => streets.nil? ? nil : streets,
|
14589
|
+
:city => city,
|
14590
|
+
:province => province,
|
14591
|
+
:postal => postal,
|
14592
|
+
:country => country,
|
14593
|
+
:latitude => latitude,
|
14594
|
+
:longitude => longitude,
|
14595
|
+
:contact => contact.nil? ? nil : contact.to_hash
|
14596
|
+
}
|
14597
|
+
end
|
14598
|
+
|
14599
|
+
end
|
14600
|
+
|
14483
14601
|
# Represents an order that has been booked. Booked orders can no longer be
|
14484
14602
|
# deleted as they represent transactions in the real world.
|
14485
14603
|
class OrderBooking
|
@@ -14718,7 +14836,7 @@ module Io
|
|
14718
14836
|
HttpClient::Preconditions.require_keys(opts, [:number, :destination, :items], 'OrderForm')
|
14719
14837
|
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
14720
14838
|
@customer = (x = opts.delete(:customer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x)))
|
14721
|
-
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::
|
14839
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
|
14722
14840
|
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
|
14723
14841
|
@discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
|
14724
14842
|
@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 })
|
@@ -14825,7 +14943,7 @@ module Io
|
|
14825
14943
|
def initialize(incoming={})
|
14826
14944
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
14827
14945
|
HttpClient::Preconditions.require_keys(opts, [:destination, :items], 'OrderPutForm')
|
14828
|
-
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::
|
14946
|
+
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
|
14829
14947
|
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
|
14830
14948
|
@customer = (x = opts.delete(:customer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x)))
|
14831
14949
|
@selections = (x = opts.delete(:selections); x.nil? ? nil : HttpClient::Preconditions.assert_class('selections', x, Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) })
|
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.1.
|
4
|
+
version: 0.1.5
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|