flowcommerce 0.2.26 → 0.2.27
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 +152 -98
- 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: ab1dc95023a303ed964f0adb8f9eac0c288aee79
|
4
|
+
data.tar.gz: e9060b2c5cec7fb264ded0f1078af480d0b639de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a49f4edbeed946b35f6d488afce063554dda1ac75db5ede54b34761cd02fdf577e81bc54ee62cb57a3cd1be7aeeb8f16813910fd0e12c4e50128f7d0527288fb
|
7
|
+
data.tar.gz: 14faba779f9dd5652ccfc7852d8f8ef139c0d99833f760b74f2e5e23efb076b0e5f74c230b648452ce6f3a56c3f2c2409c446bb959116193a7daacdc04e8dca8
|
@@ -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.
|
3
|
+
# apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.69/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.
|
28
|
+
USER_AGENT = 'apibuilder:0.12.61 https://app.apibuilder.io/flow/api/0.3.69/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
|
|
@@ -4256,6 +4256,14 @@ module Io
|
|
4256
4256
|
r.map { |x| ::Io::Flow::V0::Models::OrganizationToken.new(x) }
|
4257
4257
|
end
|
4258
4258
|
|
4259
|
+
# Create a new organization
|
4260
|
+
def post(organization, organization_token_form)
|
4261
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
4262
|
+
(x = organization_token_form; x.is_a?(::Io::Flow::V0::Models::OrganizationTokenForm) ? x : ::Io::Flow::V0::Models::OrganizationTokenForm.new(x))
|
4263
|
+
r = @client.request("/#{CGI.escape(organization)}/tokens").with_json(organization_token_form.to_json).post
|
4264
|
+
::Io::Flow::V0::Models::OrganizationToken.new(r)
|
4265
|
+
end
|
4266
|
+
|
4259
4267
|
end
|
4260
4268
|
|
4261
4269
|
class PartnerTokens
|
@@ -4279,6 +4287,14 @@ module Io
|
|
4279
4287
|
r.map { |x| ::Io::Flow::V0::Models::PartnerToken.new(x) }
|
4280
4288
|
end
|
4281
4289
|
|
4290
|
+
# Create a new partner
|
4291
|
+
def post(partner, partner_token_form)
|
4292
|
+
HttpClient::Preconditions.assert_class('partner', partner, String)
|
4293
|
+
(x = partner_token_form; x.is_a?(::Io::Flow::V0::Models::PartnerTokenForm) ? x : ::Io::Flow::V0::Models::PartnerTokenForm.new(x))
|
4294
|
+
r = @client.request("/partners/#{CGI.escape(partner)}/tokens").with_json(partner_token_form.to_json).post
|
4295
|
+
::Io::Flow::V0::Models::PartnerToken.new(r)
|
4296
|
+
end
|
4297
|
+
|
4282
4298
|
end
|
4283
4299
|
|
4284
4300
|
class PasswordResetForms
|
@@ -4379,6 +4395,14 @@ module Io
|
|
4379
4395
|
nil
|
4380
4396
|
end
|
4381
4397
|
|
4398
|
+
def put_organizations_by_session_and_organization(session, organization, session_put_form)
|
4399
|
+
HttpClient::Preconditions.assert_class('session', session, String)
|
4400
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
4401
|
+
(x = session_put_form; x.is_a?(::Io::Flow::V0::Models::SessionPutForm) ? x : ::Io::Flow::V0::Models::SessionPutForm.new(x))
|
4402
|
+
r = @client.request("/sessions/#{CGI.escape(session)}/organizations/#{CGI.escape(organization)}").with_json(session_put_form.to_json).put
|
4403
|
+
::Io::Flow::V0::Models::OrganizationSession.new(r)
|
4404
|
+
end
|
4405
|
+
|
4382
4406
|
# Resets the session based on the provided geo parameters.
|
4383
4407
|
def put_reset_by_session(session, session_reset_form)
|
4384
4408
|
HttpClient::Preconditions.assert_class('session', session, String)
|
@@ -4470,13 +4494,6 @@ module Io
|
|
4470
4494
|
r.map { |x| ::Io::Flow::V0::Models::Token.from_json(x) }
|
4471
4495
|
end
|
4472
4496
|
|
4473
|
-
# Create a new token for the requesting user
|
4474
|
-
def post(token_form)
|
4475
|
-
(x = token_form; x.is_a?(::Io::Flow::V0::Models::TokenForm) ? x : ::Io::Flow::V0::Models::TokenForm.from_json(x))
|
4476
|
-
r = @client.request("/tokens").with_json(token_form.to_json).post
|
4477
|
-
::Io::Flow::V0::Models::Token.from_json(r)
|
4478
|
-
end
|
4479
|
-
|
4480
4497
|
# Get metadata for the token with this ID
|
4481
4498
|
def get_by_id(id)
|
4482
4499
|
HttpClient::Preconditions.assert_class('id', id, String)
|
@@ -4821,8 +4838,10 @@ module Io
|
|
4821
4838
|
DIRECT_AUTHORIZATION_FORM = 'direct_authorization_form' unless defined?(DIRECT_AUTHORIZATION_FORM)
|
4822
4839
|
# Enables card payments with Flow as Merchant of Record
|
4823
4840
|
MERCHANT_OF_RECORD_AUTHORIZATION_FORM = 'merchant_of_record_authorization_form' unless defined?(MERCHANT_OF_RECORD_AUTHORIZATION_FORM)
|
4824
|
-
# Enables authorization via
|
4841
|
+
# Enables authorization via PayPal
|
4825
4842
|
PAYPAL_AUTHORIZATION_FORM = 'paypal_authorization_form' unless defined?(PAYPAL_AUTHORIZATION_FORM)
|
4843
|
+
# Enables authorizations via UnionPay
|
4844
|
+
UNIONPAY_AUTHORIZATION_FORM = 'unionpay_authorization_form' unless defined?(UNIONPAY_AUTHORIZATION_FORM)
|
4826
4845
|
end
|
4827
4846
|
|
4828
4847
|
attr_reader :discriminator
|
@@ -4834,7 +4853,7 @@ module Io
|
|
4834
4853
|
end
|
4835
4854
|
|
4836
4855
|
def subtype_to_hash
|
4837
|
-
raise 'Cannot serialize an instance of authorization_form directly - must use one of the specific types: direct_authorization_form, merchant_of_record_authorization_form, paypal_authorization_form'
|
4856
|
+
raise 'Cannot serialize an instance of authorization_form directly - must use one of the specific types: direct_authorization_form, merchant_of_record_authorization_form, paypal_authorization_form, unionpay_authorization_form'
|
4838
4857
|
end
|
4839
4858
|
|
4840
4859
|
def to_hash
|
@@ -4851,6 +4870,7 @@ module Io
|
|
4851
4870
|
when Types::DIRECT_AUTHORIZATION_FORM; DirectAuthorizationForm.new(hash)
|
4852
4871
|
when Types::MERCHANT_OF_RECORD_AUTHORIZATION_FORM; MerchantOfRecordAuthorizationForm.new(hash)
|
4853
4872
|
when Types::PAYPAL_AUTHORIZATION_FORM; PaypalAuthorizationForm.new(hash)
|
4873
|
+
when Types::UNIONPAY_AUTHORIZATION_FORM; UnionpayAuthorizationForm.new(hash)
|
4854
4874
|
else AuthorizationFormUndefinedType.new(:discriminator => discriminator)
|
4855
4875
|
end
|
4856
4876
|
end
|
@@ -6149,6 +6169,7 @@ module Io
|
|
6149
6169
|
|
6150
6170
|
module Types
|
6151
6171
|
PAYPAL_AUTHORIZATION_DETAILS = 'paypal_authorization_details' unless defined?(PAYPAL_AUTHORIZATION_DETAILS)
|
6172
|
+
UNIONPAY_AUTHORIZATION_DETAILS = 'unionpay_authorization_details' unless defined?(UNIONPAY_AUTHORIZATION_DETAILS)
|
6152
6173
|
end
|
6153
6174
|
|
6154
6175
|
attr_reader :discriminator
|
@@ -6160,7 +6181,7 @@ module Io
|
|
6160
6181
|
end
|
6161
6182
|
|
6162
6183
|
def subtype_to_hash
|
6163
|
-
raise 'Cannot serialize an instance of online_authorization_details directly - must use one of the specific types: paypal_authorization_details'
|
6184
|
+
raise 'Cannot serialize an instance of online_authorization_details directly - must use one of the specific types: paypal_authorization_details, unionpay_authorization_details'
|
6164
6185
|
end
|
6165
6186
|
|
6166
6187
|
def to_hash
|
@@ -6175,6 +6196,7 @@ module Io
|
|
6175
6196
|
end
|
6176
6197
|
case discriminator
|
6177
6198
|
when Types::PAYPAL_AUTHORIZATION_DETAILS; PaypalAuthorizationDetails.new(hash)
|
6199
|
+
when Types::UNIONPAY_AUTHORIZATION_DETAILS; UnionpayAuthorizationDetails.new(hash)
|
6178
6200
|
else OnlineAuthorizationDetailsUndefinedType.new(:discriminator => discriminator)
|
6179
6201
|
end
|
6180
6202
|
end
|
@@ -6766,68 +6788,6 @@ module Io
|
|
6766
6788
|
|
6767
6789
|
end
|
6768
6790
|
|
6769
|
-
class TokenForm
|
6770
|
-
|
6771
|
-
module Types
|
6772
|
-
ORGANIZATION_TOKEN_FORM = 'organization_token_form' unless defined?(ORGANIZATION_TOKEN_FORM)
|
6773
|
-
PARTNER_TOKEN_FORM = 'partner_token_form' unless defined?(PARTNER_TOKEN_FORM)
|
6774
|
-
end
|
6775
|
-
|
6776
|
-
attr_reader :discriminator
|
6777
|
-
|
6778
|
-
def initialize(incoming={})
|
6779
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6780
|
-
HttpClient::Preconditions.require_keys(opts, [:discriminator], 'TokenForm')
|
6781
|
-
@discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
|
6782
|
-
end
|
6783
|
-
|
6784
|
-
def subtype_to_hash
|
6785
|
-
raise 'Cannot serialize an instance of token_form directly - must use one of the specific types: organization_token_form, partner_token_form'
|
6786
|
-
end
|
6787
|
-
|
6788
|
-
def to_hash
|
6789
|
-
subtype_to_hash.merge(:discriminator => @discriminator)
|
6790
|
-
end
|
6791
|
-
|
6792
|
-
def TokenForm.from_json(hash)
|
6793
|
-
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
6794
|
-
discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
|
6795
|
-
if discriminator.empty?
|
6796
|
-
raise "Union type[token_form] requires a field named 'discriminator'"
|
6797
|
-
end
|
6798
|
-
case discriminator
|
6799
|
-
when Types::ORGANIZATION_TOKEN_FORM; OrganizationTokenForm.new(hash)
|
6800
|
-
when Types::PARTNER_TOKEN_FORM; PartnerTokenForm.new(hash)
|
6801
|
-
else TokenFormUndefinedType.new(:discriminator => discriminator)
|
6802
|
-
end
|
6803
|
-
end
|
6804
|
-
|
6805
|
-
end
|
6806
|
-
|
6807
|
-
class TokenFormUndefinedType < TokenForm
|
6808
|
-
|
6809
|
-
attr_reader :name
|
6810
|
-
|
6811
|
-
def initialize(incoming={})
|
6812
|
-
super(:discriminator => 'undefined_type')
|
6813
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6814
|
-
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
|
6815
|
-
end
|
6816
|
-
|
6817
|
-
def subtype_to_hash
|
6818
|
-
raise 'Unable to serialize undefined type to json'
|
6819
|
-
end
|
6820
|
-
|
6821
|
-
def copy(incoming={})
|
6822
|
-
raise 'Operation not supported for undefined type'
|
6823
|
-
end
|
6824
|
-
|
6825
|
-
def to_hash
|
6826
|
-
raise 'Operation not supported for undefined type'
|
6827
|
-
end
|
6828
|
-
|
6829
|
-
end
|
6830
|
-
|
6831
6791
|
class TokenReference
|
6832
6792
|
|
6833
6793
|
module Types
|
@@ -7376,7 +7336,7 @@ module Io
|
|
7376
7336
|
@@_match ||= AvsCode.new('match')
|
7377
7337
|
end
|
7378
7338
|
|
7379
|
-
# Partial match; see details in 'avs' model to
|
7339
|
+
# Partial match; see details in 'avs' model to understand which components
|
7380
7340
|
# matched
|
7381
7341
|
def AvsCode.partial
|
7382
7342
|
@@_partial ||= AvsCode.new('partial')
|
@@ -8802,9 +8762,9 @@ module Io
|
|
8802
8762
|
@@_harmonization_codes ||= ImportType.new('harmonization_codes')
|
8803
8763
|
end
|
8804
8764
|
|
8805
|
-
# Request for
|
8806
|
-
#
|
8807
|
-
#
|
8765
|
+
# Request for phrase suggestions to harmonize items. Request (CSV) must include
|
8766
|
+
# name, material, description columns. Response (CSV) will include up to 5
|
8767
|
+
# suggested phrases
|
8808
8768
|
def ImportType.harmonization_phrase_suggestion_request
|
8809
8769
|
@@_harmonization_phrase_suggestion_request ||= ImportType.new('harmonization_phrase_suggestion_request')
|
8810
8770
|
end
|
@@ -13255,7 +13215,7 @@ module Io
|
|
13255
13215
|
|
13256
13216
|
end
|
13257
13217
|
|
13258
|
-
# The card nonce form presents a one time token to
|
13218
|
+
# The card nonce form presents a one time token to exchange server side for a
|
13259
13219
|
# permanent, secure tokenized card
|
13260
13220
|
class CardNonceForm
|
13261
13221
|
|
@@ -22080,15 +22040,13 @@ module Io
|
|
22080
22040
|
|
22081
22041
|
# Used to create a new token. User making the request must be authorized to
|
22082
22042
|
# create a token for this organization.
|
22083
|
-
class OrganizationTokenForm
|
22043
|
+
class OrganizationTokenForm
|
22084
22044
|
|
22085
|
-
attr_reader :
|
22045
|
+
attr_reader :environment, :description
|
22086
22046
|
|
22087
22047
|
def initialize(incoming={})
|
22088
|
-
super(:discriminator => TokenForm::Types::ORGANIZATION_TOKEN_FORM)
|
22089
22048
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
22090
|
-
HttpClient::Preconditions.require_keys(opts, [:
|
22091
|
-
@organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
|
22049
|
+
HttpClient::Preconditions.require_keys(opts, [:environment], 'OrganizationTokenForm')
|
22092
22050
|
@environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
|
22093
22051
|
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
22094
22052
|
end
|
@@ -22098,12 +22056,11 @@ module Io
|
|
22098
22056
|
end
|
22099
22057
|
|
22100
22058
|
def copy(incoming={})
|
22101
|
-
OrganizationTokenForm.new(
|
22059
|
+
OrganizationTokenForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
22102
22060
|
end
|
22103
22061
|
|
22104
|
-
def
|
22062
|
+
def to_hash
|
22105
22063
|
{
|
22106
|
-
:organization => organization,
|
22107
22064
|
:environment => environment.value,
|
22108
22065
|
:description => description
|
22109
22066
|
}
|
@@ -22386,15 +22343,13 @@ module Io
|
|
22386
22343
|
|
22387
22344
|
# Used to create a new token. User making the request must be authorized to
|
22388
22345
|
# create a token for this partner.
|
22389
|
-
class PartnerTokenForm
|
22346
|
+
class PartnerTokenForm
|
22390
22347
|
|
22391
|
-
attr_reader :
|
22348
|
+
attr_reader :environment, :description
|
22392
22349
|
|
22393
22350
|
def initialize(incoming={})
|
22394
|
-
super(:discriminator => TokenForm::Types::PARTNER_TOKEN_FORM)
|
22395
22351
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
22396
|
-
HttpClient::Preconditions.require_keys(opts, [:
|
22397
|
-
@partner = HttpClient::Preconditions.assert_class('partner', opts.delete(:partner), String)
|
22352
|
+
HttpClient::Preconditions.require_keys(opts, [:environment], 'PartnerTokenForm')
|
22398
22353
|
@environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x))
|
22399
22354
|
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
22400
22355
|
end
|
@@ -22404,12 +22359,11 @@ module Io
|
|
22404
22359
|
end
|
22405
22360
|
|
22406
22361
|
def copy(incoming={})
|
22407
|
-
PartnerTokenForm.new(
|
22362
|
+
PartnerTokenForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
22408
22363
|
end
|
22409
22364
|
|
22410
|
-
def
|
22365
|
+
def to_hash
|
22411
22366
|
{
|
22412
|
-
:partner => partner,
|
22413
22367
|
:environment => environment.value,
|
22414
22368
|
:description => description
|
22415
22369
|
}
|
@@ -22723,7 +22677,7 @@ module Io
|
|
22723
22677
|
|
22724
22678
|
end
|
22725
22679
|
|
22726
|
-
# Represents
|
22680
|
+
# Represents an online payment processed through PayPal.
|
22727
22681
|
class PaymentPaypal < Payment
|
22728
22682
|
|
22729
22683
|
attr_reader :id, :order, :amount, :currency, :paypal
|
@@ -22907,7 +22861,7 @@ module Io
|
|
22907
22861
|
|
22908
22862
|
end
|
22909
22863
|
|
22910
|
-
# Executes the
|
22864
|
+
# Executes the PayPal payment
|
22911
22865
|
class PaypalAuthorizationForm < AuthorizationForm
|
22912
22866
|
|
22913
22867
|
attr_reader :paypal_payment_id, :paypal_payer_id, :key, :attributes, :ip
|
@@ -23064,6 +23018,36 @@ module Io
|
|
23064
23018
|
|
23065
23019
|
end
|
23066
23020
|
|
23021
|
+
# The URLs to which the customer will be redirected based on the authorization
|
23022
|
+
# status.
|
23023
|
+
class PostPaymentRedirectUrls
|
23024
|
+
|
23025
|
+
attr_reader :success, :failure
|
23026
|
+
|
23027
|
+
def initialize(incoming={})
|
23028
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
23029
|
+
HttpClient::Preconditions.require_keys(opts, [:success], 'PostPaymentRedirectUrls')
|
23030
|
+
@success = HttpClient::Preconditions.assert_class('success', opts.delete(:success), String)
|
23031
|
+
@failure = (x = opts.delete(:failure); x.nil? ? nil : HttpClient::Preconditions.assert_class('failure', x, String))
|
23032
|
+
end
|
23033
|
+
|
23034
|
+
def to_json
|
23035
|
+
JSON.dump(to_hash)
|
23036
|
+
end
|
23037
|
+
|
23038
|
+
def copy(incoming={})
|
23039
|
+
PostPaymentRedirectUrls.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
23040
|
+
end
|
23041
|
+
|
23042
|
+
def to_hash
|
23043
|
+
{
|
23044
|
+
:success => success,
|
23045
|
+
:failure => failure
|
23046
|
+
}
|
23047
|
+
end
|
23048
|
+
|
23049
|
+
end
|
23050
|
+
|
23067
23051
|
# Represents an amount-currency pair for a basic price
|
23068
23052
|
class Price
|
23069
23053
|
|
@@ -24177,7 +24161,7 @@ module Io
|
|
24177
24161
|
|
24178
24162
|
end
|
24179
24163
|
|
24180
|
-
# Detailed examples of amount to refund following common
|
24164
|
+
# Detailed examples of amount to refund following common e-commerce use cases.
|
24181
24165
|
class RefundOrderSummaryAmounts
|
24182
24166
|
|
24183
24167
|
attr_reader :balance, :balance_excluding_shipping, :shipping
|
@@ -27712,6 +27696,76 @@ module Io
|
|
27712
27696
|
|
27713
27697
|
end
|
27714
27698
|
|
27699
|
+
# Represents on line payment
|
27700
|
+
class UnionpayAuthorizationDetails < OnlineAuthorizationDetails
|
27701
|
+
|
27702
|
+
attr_reader :id, :payment_redirect_url
|
27703
|
+
|
27704
|
+
def initialize(incoming={})
|
27705
|
+
super(:discriminator => OnlineAuthorizationDetails::Types::UNIONPAY_AUTHORIZATION_DETAILS)
|
27706
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
27707
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :payment_redirect_url], 'UnionpayAuthorizationDetails')
|
27708
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
27709
|
+
@payment_redirect_url = HttpClient::Preconditions.assert_class('payment_redirect_url', opts.delete(:payment_redirect_url), String)
|
27710
|
+
end
|
27711
|
+
|
27712
|
+
def to_json
|
27713
|
+
JSON.dump(to_hash)
|
27714
|
+
end
|
27715
|
+
|
27716
|
+
def copy(incoming={})
|
27717
|
+
UnionpayAuthorizationDetails.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
27718
|
+
end
|
27719
|
+
|
27720
|
+
def subtype_to_hash
|
27721
|
+
{
|
27722
|
+
:id => id,
|
27723
|
+
:payment_redirect_url => payment_redirect_url
|
27724
|
+
}
|
27725
|
+
end
|
27726
|
+
|
27727
|
+
end
|
27728
|
+
|
27729
|
+
# Executes the UnionPay payment
|
27730
|
+
class UnionpayAuthorizationForm < AuthorizationForm
|
27731
|
+
|
27732
|
+
attr_reader :order_number, :amount, :currency, :post_payment_redirect_urls, :key, :attributes, :ip
|
27733
|
+
|
27734
|
+
def initialize(incoming={})
|
27735
|
+
super(:discriminator => AuthorizationForm::Types::UNIONPAY_AUTHORIZATION_FORM)
|
27736
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
27737
|
+
HttpClient::Preconditions.require_keys(opts, [:order_number, :amount, :currency, :post_payment_redirect_urls], 'UnionpayAuthorizationForm')
|
27738
|
+
@order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
|
27739
|
+
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
27740
|
+
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
27741
|
+
@post_payment_redirect_urls = (x = opts.delete(:post_payment_redirect_urls); x.is_a?(::Io::Flow::V0::Models::PostPaymentRedirectUrls) ? x : ::Io::Flow::V0::Models::PostPaymentRedirectUrls.new(x))
|
27742
|
+
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
27743
|
+
@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 })
|
27744
|
+
@ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
|
27745
|
+
end
|
27746
|
+
|
27747
|
+
def to_json
|
27748
|
+
JSON.dump(to_hash)
|
27749
|
+
end
|
27750
|
+
|
27751
|
+
def copy(incoming={})
|
27752
|
+
UnionpayAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
27753
|
+
end
|
27754
|
+
|
27755
|
+
def subtype_to_hash
|
27756
|
+
{
|
27757
|
+
:order_number => order_number,
|
27758
|
+
:amount => amount,
|
27759
|
+
:currency => currency,
|
27760
|
+
:post_payment_redirect_urls => post_payment_redirect_urls.to_hash,
|
27761
|
+
:key => key,
|
27762
|
+
:attributes => attributes.nil? ? nil : attributes,
|
27763
|
+
:ip => ip
|
27764
|
+
}
|
27765
|
+
end
|
27766
|
+
|
27767
|
+
end
|
27768
|
+
|
27715
27769
|
# Provides the ability to upload a file to a URL (an expiring s3 url, usually
|
27716
27770
|
# valid for 1 week)
|
27717
27771
|
class Upload
|
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.
|
4
|
+
version: 0.2.27
|
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-08-
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|