flowcommerce 0.2.41 → 0.2.42

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 695d9dbc8e0bfd3b7a6296f83d69b45f2318bf32
4
- data.tar.gz: e2acab12aa851b59f5e0d76d7ec9e9bda5cf35fa
3
+ metadata.gz: 741d2dcff41d965386804f4c5626a547c4c694e4
4
+ data.tar.gz: c8865a9ae02101e0549ebfc04cb5b58912847168
5
5
  SHA512:
6
- metadata.gz: 9b2fe5b78d80b325b9773a186d880e5804820dc5ffd39f78fe64d94d86fb625884cf546abc5ba6a17ec46a43834e01a6140e167ab176eb5747f54369107f74cf
7
- data.tar.gz: 044f7df50f12243072644d6d1e0ce31a1090222786fc4956cd51e0940bef08e5b6b84578a356064a72640799d0ed2c653f4d1d5fa52c89bf4bbe700dda5de3d7
6
+ metadata.gz: 08cae3c4feab9a97c2a4ef0f0c4982e56b25c07159ac4b5d808878ba86b4809154f4202123a64f29d7db364412502eb66b71591639094bfc2e98774c049ce595
7
+ data.tar.gz: f9be5d92e23fd67fc63ebb0266ae61b14c7e49f3d0b6602125412bae63afb7c0aea116d83ae4653ecfae1948a4ee69bd094661ab6c8dfbe40e2746defc4856b6
@@ -1,6 +1,6 @@
1
1
  # Generated by API Builder - https://www.apibuilder.io
2
2
  # Service version: 0.3.65
3
- # apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.99/ruby_client
3
+ # apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.4.2/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,7 +25,7 @@ module Io
25
25
 
26
26
  BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
27
27
  NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
28
- USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.99/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.4.2/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.3.65' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -1149,6 +1149,14 @@ module Io
1149
1149
  r.map { |x| ::Io::Flow::V0::Models::OrderVersion.new(x) }
1150
1150
  end
1151
1151
 
1152
+ # Returns the current fraud status for this order
1153
+ def get_status_and_fraud_by_number(organization, number)
1154
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1155
+ HttpClient::Preconditions.assert_class('number', number, String)
1156
+ r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}/status/fraud").get
1157
+ ::Io::Flow::V0::Models::OrderFraudStatus.new(r)
1158
+ end
1159
+
1152
1160
  end
1153
1161
 
1154
1162
  class OrderEstimates
@@ -8965,6 +8973,55 @@ module Io
8965
8973
 
8966
8974
  end
8967
8975
 
8976
+ class FraudStatus
8977
+
8978
+ attr_reader :value
8979
+
8980
+ def initialize(value)
8981
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
8982
+ end
8983
+
8984
+ # Returns the instance of FraudStatus for this value, creating a new instance for an unknown value
8985
+ def FraudStatus.apply(value)
8986
+ if value.instance_of?(FraudStatus)
8987
+ value
8988
+ else
8989
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
8990
+ value.nil? ? nil : (from_string(value) || FraudStatus.new(value))
8991
+ end
8992
+ end
8993
+
8994
+ # Returns the instance of FraudStatus for this value, or nil if not found
8995
+ def FraudStatus.from_string(value)
8996
+ HttpClient::Preconditions.assert_class('value', value, String)
8997
+ FraudStatus.ALL.find { |v| v.value == value }
8998
+ end
8999
+
9000
+ def FraudStatus.ALL
9001
+ @@all ||= [FraudStatus.pending, FraudStatus.approved, FraudStatus.declined]
9002
+ end
9003
+
9004
+ # If an immediate response is not available, the state will be 'pending'.
9005
+ def FraudStatus.pending
9006
+ @@_pending ||= FraudStatus.new('pending')
9007
+ end
9008
+
9009
+ # Fraud check has passed and the order is approved.
9010
+ def FraudStatus.approved
9011
+ @@_approved ||= FraudStatus.new('approved')
9012
+ end
9013
+
9014
+ # Indicates the fraud check has been declined by the fraud providing service.
9015
+ def FraudStatus.declined
9016
+ @@_declined ||= FraudStatus.new('declined')
9017
+ end
9018
+
9019
+ def to_hash
9020
+ value
9021
+ end
9022
+
9023
+ end
9024
+
8968
9025
  class FulfillmentMethodType
8969
9026
 
8970
9027
  attr_reader :value
@@ -13005,13 +13062,14 @@ module Io
13005
13062
 
13006
13063
  class AuthorizationReference
13007
13064
 
13008
- attr_reader :id, :key
13065
+ attr_reader :id, :key, :order
13009
13066
 
13010
13067
  def initialize(incoming={})
13011
13068
  opts = HttpClient::Helper.symbolize_keys(incoming)
13012
13069
  HttpClient::Preconditions.require_keys(opts, [:id, :key], 'AuthorizationReference')
13013
13070
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
13014
13071
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
13072
+ @order = (x = opts.delete(:order); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::AuthorizationOrderReference) ? x : ::Io::Flow::V0::Models::AuthorizationOrderReference.new(x)))
13015
13073
  end
13016
13074
 
13017
13075
  def to_json
@@ -13025,7 +13083,8 @@ module Io
13025
13083
  def to_hash
13026
13084
  {
13027
13085
  :id => id,
13028
- :key => key
13086
+ :key => key,
13087
+ :order => order.nil? ? nil : order.to_hash
13029
13088
  }
13030
13089
  end
13031
13090
 
@@ -16632,32 +16691,6 @@ module Io
16632
16691
 
16633
16692
  end
16634
16693
 
16635
- class Ference
16636
-
16637
- attr_reader :id
16638
-
16639
- def initialize(incoming={})
16640
- opts = HttpClient::Helper.symbolize_keys(incoming)
16641
- HttpClient::Preconditions.require_keys(opts, [:id], 'Ference')
16642
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
16643
- end
16644
-
16645
- def to_json
16646
- JSON.dump(to_hash)
16647
- end
16648
-
16649
- def copy(incoming={})
16650
- Ference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
16651
- end
16652
-
16653
- def to_hash
16654
- {
16655
- :id => id
16656
- }
16657
- end
16658
-
16659
- end
16660
-
16661
16694
  # Rule outcome where shipping surfaced in quote is pre-defined flat rate
16662
16695
  class FlatRate < TierRuleOutcome
16663
16696
 
@@ -18803,6 +18836,32 @@ module Io
18803
18836
 
18804
18837
  end
18805
18838
 
18839
+ class IssuerReference
18840
+
18841
+ attr_reader :id
18842
+
18843
+ def initialize(incoming={})
18844
+ opts = HttpClient::Helper.symbolize_keys(incoming)
18845
+ HttpClient::Preconditions.require_keys(opts, [:id], 'IssuerReference')
18846
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
18847
+ end
18848
+
18849
+ def to_json
18850
+ JSON.dump(to_hash)
18851
+ end
18852
+
18853
+ def copy(incoming={})
18854
+ IssuerReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18855
+ end
18856
+
18857
+ def to_hash
18858
+ {
18859
+ :id => id
18860
+ }
18861
+ end
18862
+
18863
+ end
18864
+
18806
18865
  # The Flow item defines a specific item that can be purchased by a consumer. For
18807
18866
  # many clients, this will map to a Sku.
18808
18867
  class Item
@@ -21630,6 +21689,34 @@ module Io
21630
21689
 
21631
21690
  end
21632
21691
 
21692
+ class OrderFraudStatus
21693
+
21694
+ attr_reader :order, :status
21695
+
21696
+ def initialize(incoming={})
21697
+ opts = HttpClient::Helper.symbolize_keys(incoming)
21698
+ HttpClient::Preconditions.require_keys(opts, [:order, :status], 'OrderFraudStatus')
21699
+ @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderReference) ? x : ::Io::Flow::V0::Models::OrderReference.new(x))
21700
+ @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::FraudStatus) ? x : ::Io::Flow::V0::Models::FraudStatus.apply(x))
21701
+ end
21702
+
21703
+ def to_json
21704
+ JSON.dump(to_hash)
21705
+ end
21706
+
21707
+ def copy(incoming={})
21708
+ OrderFraudStatus.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
21709
+ end
21710
+
21711
+ def to_hash
21712
+ {
21713
+ :order => order.to_hash,
21714
+ :status => status.value
21715
+ }
21716
+ end
21717
+
21718
+ end
21719
+
21633
21720
  # Represents alternate numbers with which to identify an order.
21634
21721
  class OrderIdentifier
21635
21722
 
@@ -23371,9 +23458,37 @@ module Io
23371
23458
 
23372
23459
  end
23373
23460
 
23461
+ class PaymentMethodIssuer
23462
+
23463
+ attr_reader :id, :name
23464
+
23465
+ def initialize(incoming={})
23466
+ opts = HttpClient::Helper.symbolize_keys(incoming)
23467
+ HttpClient::Preconditions.require_keys(opts, [:id, :name], 'PaymentMethodIssuer')
23468
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
23469
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
23470
+ end
23471
+
23472
+ def to_json
23473
+ JSON.dump(to_hash)
23474
+ end
23475
+
23476
+ def copy(incoming={})
23477
+ PaymentMethodIssuer.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
23478
+ end
23479
+
23480
+ def to_hash
23481
+ {
23482
+ :id => id,
23483
+ :name => name
23484
+ }
23485
+ end
23486
+
23487
+ end
23488
+
23374
23489
  class PaymentMethodRule
23375
23490
 
23376
- attr_reader :tags, :payment_method, :display_position, :content
23491
+ attr_reader :tags, :payment_method, :display_position, :content, :issuers
23377
23492
 
23378
23493
  def initialize(incoming={})
23379
23494
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -23382,6 +23497,7 @@ module Io
23382
23497
  @payment_method = (x = opts.delete(:payment_method); x.is_a?(::Io::Flow::V0::Models::PaymentMethod) ? x : ::Io::Flow::V0::Models::PaymentMethod.new(x))
23383
23498
  @display_position = HttpClient::Preconditions.assert_class('display_position', opts.delete(:display_position), Integer)
23384
23499
  @content = (x = opts.delete(:content); x.nil? ? nil : HttpClient::Preconditions.assert_class('content', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodRuleContent) ? x : ::Io::Flow::V0::Models::PaymentMethodRuleContent.new(x)) })
23500
+ @issuers = (x = opts.delete(:issuers); x.nil? ? nil : HttpClient::Preconditions.assert_class('issuers', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodIssuer) ? x : ::Io::Flow::V0::Models::PaymentMethodIssuer.new(x)) })
23385
23501
  end
23386
23502
 
23387
23503
  def to_json
@@ -23397,7 +23513,8 @@ module Io
23397
23513
  :tags => tags.map { |o| o.to_hash },
23398
23514
  :payment_method => payment_method.to_hash,
23399
23515
  :display_position => display_position,
23400
- :content => content.nil? ? nil : content.map { |o| o.to_hash }
23516
+ :content => content.nil? ? nil : content.map { |o| o.to_hash },
23517
+ :issuers => issuers.nil? ? nil : issuers.map { |o| o.to_hash }
23401
23518
  }
23402
23519
  end
23403
23520
 
@@ -24434,16 +24551,17 @@ module Io
24434
24551
  # that delivery
24435
24552
  class Quote
24436
24553
 
24437
- attr_reader :id, :destination, :deliveries, :selections, :delivered_duty
24554
+ attr_reader :id, :destination, :deliveries, :selections, :delivered_duty, :delivered_duties
24438
24555
 
24439
24556
  def initialize(incoming={})
24440
24557
  opts = HttpClient::Helper.symbolize_keys(incoming)
24441
- HttpClient::Preconditions.require_keys(opts, [:id, :destination, :deliveries, :selections], 'Quote')
24558
+ HttpClient::Preconditions.require_keys(opts, [:id, :destination, :deliveries, :selections, :delivered_duties], 'Quote')
24442
24559
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
24443
24560
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
24444
24561
  @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.from_json(x)) }
24445
24562
  @selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryOptionReference) ? x : ::Io::Flow::V0::Models::DeliveryOptionReference.new(x)) }
24446
24563
  @delivered_duty = (x = (x = opts.delete(:delivered_duty); x.nil? ? "paid" : x); x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x))
24564
+ @delivered_duties = HttpClient::Preconditions.assert_class('delivered_duties', opts.delete(:delivered_duties), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x)) }
24447
24565
  end
24448
24566
 
24449
24567
  def to_json
@@ -24460,7 +24578,8 @@ module Io
24460
24578
  :destination => destination.to_hash,
24461
24579
  :deliveries => deliveries.map { |o| o.to_hash },
24462
24580
  :selections => selections.map { |o| o.to_hash },
24463
- :delivered_duty => delivered_duty.value
24581
+ :delivered_duty => delivered_duty.value,
24582
+ :delivered_duties => delivered_duties.map { |o| o.value }
24464
24583
  }
24465
24584
  end
24466
24585
 
@@ -24498,7 +24617,7 @@ module Io
24498
24617
 
24499
24618
  class QuoteForm
24500
24619
 
24501
- attr_reader :destination, :experience, :items, :delivered_duty
24620
+ attr_reader :destination, :experience, :items, :delivered_duty, :delivered_duties
24502
24621
 
24503
24622
  def initialize(incoming={})
24504
24623
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -24507,6 +24626,7 @@ module Io
24507
24626
  @experience = HttpClient::Preconditions.assert_class('experience', opts.delete(:experience), String)
24508
24627
  @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)) }
24509
24628
  @delivered_duty = (x = opts.delete(:delivered_duty); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x)))
24629
+ @delivered_duties = (x = opts.delete(:delivered_duties); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivered_duties', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x)) })
24510
24630
  end
24511
24631
 
24512
24632
  def to_json
@@ -24522,7 +24642,8 @@ module Io
24522
24642
  :destination => destination.to_hash,
24523
24643
  :experience => experience,
24524
24644
  :items => items.map { |o| o.to_hash },
24525
- :delivered_duty => delivered_duty.nil? ? nil : delivered_duty.value
24645
+ :delivered_duty => delivered_duty.nil? ? nil : delivered_duty.value,
24646
+ :delivered_duties => delivered_duties.nil? ? nil : delivered_duties.map { |o| o.value }
24526
24647
  }
24527
24648
  end
24528
24649
 
@@ -24793,13 +24914,14 @@ module Io
24793
24914
  # Executes a redirect-based payment based on the provided payment method.
24794
24915
  class RedirectAuthorizationForm < AuthorizationForm
24795
24916
 
24796
- attr_reader :method, :order_number, :amount, :currency, :redirect_urls, :key, :attributes, :ip
24917
+ attr_reader :method, :issuer, :order_number, :amount, :currency, :redirect_urls, :key, :attributes, :ip
24797
24918
 
24798
24919
  def initialize(incoming={})
24799
24920
  super(:discriminator => AuthorizationForm::Types::REDIRECT_AUTHORIZATION_FORM)
24800
24921
  opts = HttpClient::Helper.symbolize_keys(incoming)
24801
24922
  HttpClient::Preconditions.require_keys(opts, [:method, :order_number, :amount, :currency, :redirect_urls], 'RedirectAuthorizationForm')
24802
24923
  @method = HttpClient::Preconditions.assert_class('method', opts.delete(:method), String)
24924
+ @issuer = (x = opts.delete(:issuer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::IssuerReference) ? x : ::Io::Flow::V0::Models::IssuerReference.new(x)))
24803
24925
  @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
24804
24926
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
24805
24927
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
@@ -24820,6 +24942,7 @@ module Io
24820
24942
  def subtype_to_hash
24821
24943
  {
24822
24944
  :method => method,
24945
+ :issuer => issuer.nil? ? nil : issuer.to_hash,
24823
24946
  :order_number => order_number,
24824
24947
  :amount => amount,
24825
24948
  :currency => currency,
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.41
4
+ version: 0.2.42
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-10-08 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json