flowcommerce 0.2.37 → 0.2.38
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.
- data/lib/flow_commerce/flow_api_v0_client.rb +41 -21
- metadata +13 -9
- checksums.yaml +0 -7
@@ -735,7 +735,19 @@ module Io
|
|
735
735
|
r.map { |x| ::Io::Flow::V0::Models::ItemMarginVersion.new(x) }
|
736
736
|
end
|
737
737
|
|
738
|
-
def
|
738
|
+
def get_payment_method_types_by_experience_key(organization, experience_key, incoming={})
|
739
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
740
|
+
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
741
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
742
|
+
query = {
|
743
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
744
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer)
|
745
|
+
}.delete_if { |k, v| v.nil? }
|
746
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment-method-types").with_query(query).get
|
747
|
+
r.map { |x| ::Io::Flow::V0::Models::PaymentMethodType.new(x) }
|
748
|
+
end
|
749
|
+
|
750
|
+
def get_payment_and_method_and_rules_by_experience_key(organization, experience_key, incoming={})
|
739
751
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
740
752
|
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
741
753
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -746,32 +758,20 @@ module Io
|
|
746
758
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
747
759
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "display_position" : x), String)
|
748
760
|
}.delete_if { |k, v| v.nil? }
|
749
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment
|
761
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment/method/rules").with_query(query).get
|
750
762
|
r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) }
|
751
763
|
end
|
752
764
|
|
753
765
|
# Change the ordering or payment tags for an experience. Every post must
|
754
766
|
# include one entry for each payment method offered by Flow.
|
755
|
-
def
|
767
|
+
def put_payment_and_method_and_rules_by_experience_key(organization, experience_key, experience_payment_method_rule_forms)
|
756
768
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
757
769
|
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
758
770
|
HttpClient::Preconditions.assert_class('experience_payment_method_rule_forms', experience_payment_method_rule_forms, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperiencePaymentMethodRuleForm) ? x : ::Io::Flow::V0::Models::ExperiencePaymentMethodRuleForm.new(x)) }
|
759
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment
|
771
|
+
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment/method/rules").with_json(experience_payment_method_rule_forms.map { |o| o.to_hash }.to_json).put
|
760
772
|
r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) }
|
761
773
|
end
|
762
774
|
|
763
|
-
def get_payment_method_types_by_experience_key(organization, experience_key, incoming={})
|
764
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
765
|
-
HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
|
766
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
767
|
-
query = {
|
768
|
-
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
769
|
-
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer)
|
770
|
-
}.delete_if { |k, v| v.nil? }
|
771
|
-
r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment-method-types").with_query(query).get
|
772
|
-
r.map { |x| ::Io::Flow::V0::Models::PaymentMethodType.new(x) }
|
773
|
-
end
|
774
|
-
|
775
775
|
# Returns information about a specific experience.
|
776
776
|
def get_by_key(organization, key)
|
777
777
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
@@ -1399,7 +1399,7 @@ module Io
|
|
1399
1399
|
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
1400
1400
|
end
|
1401
1401
|
|
1402
|
-
def
|
1402
|
+
def get_payment_method_rules(organization, incoming={})
|
1403
1403
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1404
1404
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1405
1405
|
query = {
|
@@ -1415,6 +1415,22 @@ module Io
|
|
1415
1415
|
r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) }
|
1416
1416
|
end
|
1417
1417
|
|
1418
|
+
def get_payment_and_method_and_rules(organization, incoming={})
|
1419
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1420
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1421
|
+
query = {
|
1422
|
+
:country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)),
|
1423
|
+
:currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),
|
1424
|
+
:experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
|
1425
|
+
:ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
|
1426
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1427
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1428
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "display_position" : x), String)
|
1429
|
+
}.delete_if { |k, v| v.nil? }
|
1430
|
+
r = @client.request("/#{CGI.escape(organization)}/payment/method/rules").with_query(query).get
|
1431
|
+
r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) }
|
1432
|
+
end
|
1433
|
+
|
1418
1434
|
end
|
1419
1435
|
|
1420
1436
|
class Queries
|
@@ -12365,7 +12381,7 @@ module Io
|
|
12365
12381
|
# rounding, shipping, etc.
|
12366
12382
|
class AllocationDetailComponent < AllocationComponent
|
12367
12383
|
|
12368
|
-
attr_reader :key, :total
|
12384
|
+
attr_reader :key, :total, :price
|
12369
12385
|
|
12370
12386
|
def initialize(incoming={})
|
12371
12387
|
super(:discriminator => AllocationComponent::Types::ALLOCATION_DETAIL_COMPONENT)
|
@@ -12373,6 +12389,7 @@ module Io
|
|
12373
12389
|
HttpClient::Preconditions.require_keys(opts, [:key, :total], 'AllocationDetailComponent')
|
12374
12390
|
@key = (x = opts.delete(:key); x.is_a?(::Io::Flow::V0::Models::OrderPriceDetailComponentKey) ? x : ::Io::Flow::V0::Models::OrderPriceDetailComponentKey.apply(x))
|
12375
12391
|
@total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
|
12392
|
+
@price = (x = opts.delete(:price); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x)))
|
12376
12393
|
end
|
12377
12394
|
|
12378
12395
|
def to_json
|
@@ -12386,7 +12403,8 @@ module Io
|
|
12386
12403
|
def subtype_to_hash
|
12387
12404
|
{
|
12388
12405
|
:key => key.value,
|
12389
|
-
:total => total.to_hash
|
12406
|
+
:total => total.to_hash,
|
12407
|
+
:price => price.nil? ? nil : price.to_hash
|
12390
12408
|
}
|
12391
12409
|
end
|
12392
12410
|
|
@@ -12395,7 +12413,7 @@ module Io
|
|
12395
12413
|
# Represents either a VAT or duty component.
|
12396
12414
|
class AllocationLevyComponent < AllocationComponent
|
12397
12415
|
|
12398
|
-
attr_reader :key, :total, :rate, :name
|
12416
|
+
attr_reader :key, :total, :rate, :name, :price
|
12399
12417
|
|
12400
12418
|
def initialize(incoming={})
|
12401
12419
|
super(:discriminator => AllocationComponent::Types::ALLOCATION_LEVY_COMPONENT)
|
@@ -12405,6 +12423,7 @@ module Io
|
|
12405
12423
|
@total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
|
12406
12424
|
@rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
|
12407
12425
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
12426
|
+
@price = (x = opts.delete(:price); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x)))
|
12408
12427
|
end
|
12409
12428
|
|
12410
12429
|
def to_json
|
@@ -12420,7 +12439,8 @@ module Io
|
|
12420
12439
|
:key => key.value,
|
12421
12440
|
:total => total.to_hash,
|
12422
12441
|
:rate => rate,
|
12423
|
-
:name => name
|
12442
|
+
:name => name,
|
12443
|
+
:price => price.nil? ? nil : price.to_hash
|
12424
12444
|
}
|
12425
12445
|
end
|
12426
12446
|
|
metadata
CHANGED
@@ -1,27 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowcommerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.38
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Flow Commerce, Inc.
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
12
|
+
date: 2017-09-25 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: json
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0'
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0'
|
27
30
|
description: Native ruby client for the Flow REST API. Detailed information at https://app.apibuilder.io/flow/api
|
@@ -38,25 +41,26 @@ files:
|
|
38
41
|
homepage: https://github.com/flowcommerce/ruby-sdk
|
39
42
|
licenses:
|
40
43
|
- MIT
|
41
|
-
metadata: {}
|
42
44
|
post_install_message:
|
43
45
|
rdoc_options: []
|
44
46
|
require_paths:
|
45
47
|
- lib
|
46
48
|
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
47
50
|
requirements:
|
48
|
-
- - '>='
|
51
|
+
- - ! '>='
|
49
52
|
- !ruby/object:Gem::Version
|
50
53
|
version: '0'
|
51
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
52
56
|
requirements:
|
53
|
-
- - '>='
|
57
|
+
- - ! '>='
|
54
58
|
- !ruby/object:Gem::Version
|
55
59
|
version: '0'
|
56
60
|
requirements: []
|
57
61
|
rubyforge_project:
|
58
|
-
rubygems_version:
|
62
|
+
rubygems_version: 1.8.23.2
|
59
63
|
signing_key:
|
60
|
-
specification_version:
|
64
|
+
specification_version: 3
|
61
65
|
summary: Native ruby client for the Flow REST API.
|
62
66
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 6ff31060093b378921a5f2df64ed4adabc176b6a
|
4
|
-
data.tar.gz: 069ac17d106a0156b2e355e25a099597b0ff242f
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 31c75f24bc581446f15b50e5ac936dfba4505d4f4160a07663a7d245fbe927446b5403781aa712a6c933e787012a37686db6c393c42d1b69571af1a6b950ca76
|
7
|
-
data.tar.gz: 85d01e51b67531337a7f4929c86d3312fd8c98226baf9d11bd010693fcf35a01d566ae329d9d54da3c71d155e6534cb0bd41b877b1b214be644e92bfd7447447
|