flowcommerce 0.0.44 → 0.0.45
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 +162 -48
- 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: 66bbca2281967a2708da56dfe063a8a7baab9370
|
4
|
+
data.tar.gz: 507ac2ae0fba539530eab52f4cb4d1a9a09412f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69b0c2a6752b6cdd293f530be330402fde9087212ff57cfda8305efc4a06bb0c03f68a191370b527bfacfca8a43a3feefce1329e91bb2d5b050bd494dbea1c97
|
7
|
+
data.tar.gz: 321c3223c193176fc2d3fd25d3da9a54710cff313c3524ff49ee26e6a033f263971d8292c24481986ea734911da50c898b089ae5d3e84123fe1332d3d4df5748
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.1.
|
3
|
-
# apidoc:0.11.
|
2
|
+
# Service version: 0.1.26
|
3
|
+
# apidoc:0.11.35 http://www.apidoc.me/flow/api/0.1.26/ruby_client
|
4
4
|
|
5
5
|
require 'cgi'
|
6
6
|
require 'net/http'
|
@@ -25,8 +25,8 @@ 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.
|
29
|
-
VERSION = '0.1.
|
28
|
+
USER_AGENT = 'apidoc:0.11.35 http://www.apidoc.me/flow/api/0.1.26/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.1.26' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -257,10 +257,6 @@ module Io
|
|
257
257
|
@regions ||= ::Io::Flow::V0::Clients::Regions.new(self)
|
258
258
|
end
|
259
259
|
|
260
|
-
def timezones
|
261
|
-
@timezones ||= ::Io::Flow::V0::Clients::Timezones.new(self)
|
262
|
-
end
|
263
|
-
|
264
260
|
def documents
|
265
261
|
@documents ||= ::Io::Flow::V0::Clients::Documents.new(self)
|
266
262
|
end
|
@@ -2365,21 +2361,21 @@ module Io
|
|
2365
2361
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2366
2362
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
2367
2363
|
}.delete_if { |k, v| v.nil? }
|
2368
|
-
r = @client.request("/#{CGI.escape(organization)}/
|
2364
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping_labels").with_query(query).get
|
2369
2365
|
r.map { |x| ::Io::Flow::V0::Models::ShippingLabel.new(x) }
|
2370
2366
|
end
|
2371
2367
|
|
2372
2368
|
def post(organization, shipping_label_form)
|
2373
2369
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2374
2370
|
HttpClient::Preconditions.assert_class('shipping_label_form', shipping_label_form, ::Io::Flow::V0::Models::ShippingLabelForm)
|
2375
|
-
r = @client.request("/#{CGI.escape(organization)}/
|
2371
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping_labels").with_json(shipping_label_form.to_json).post
|
2376
2372
|
::Io::Flow::V0::Models::ShippingLabel.new(r)
|
2377
2373
|
end
|
2378
2374
|
|
2379
2375
|
def get_by_id(organization, id)
|
2380
2376
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
2381
2377
|
HttpClient::Preconditions.assert_class('id', id, String)
|
2382
|
-
r = @client.request("/#{CGI.escape(organization)}/
|
2378
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping_labels/#{CGI.escape(id)}").get
|
2383
2379
|
::Io::Flow::V0::Models::ShippingLabel.new(r)
|
2384
2380
|
end
|
2385
2381
|
|
@@ -2393,7 +2389,7 @@ module Io
|
|
2393
2389
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
2394
2390
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
2395
2391
|
}.delete_if { |k, v| v.nil? }
|
2396
|
-
r = @client.request("/#{CGI.escape(organization)}/
|
2392
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping_labels/versions").with_query(query).get
|
2397
2393
|
r.map { |x| ::Io::Flow::V0::Models::ShippingLabelVersion.new(x) }
|
2398
2394
|
end
|
2399
2395
|
|
@@ -2791,6 +2787,16 @@ module Io
|
|
2791
2787
|
r.map { |x| ::Io::Flow::V0::Models::Timezone.new(x) }
|
2792
2788
|
end
|
2793
2789
|
|
2790
|
+
# Returns a list of timezones.
|
2791
|
+
def get_reference_and_timezones(incoming={})
|
2792
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2793
|
+
query = {
|
2794
|
+
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
2795
|
+
}.delete_if { |k, v| v.nil? }
|
2796
|
+
r = @client.request("/reference/timezones").with_query(query).get
|
2797
|
+
r.map { |x| ::Io::Flow::V0::Models::Timezone.new(x) }
|
2798
|
+
end
|
2799
|
+
|
2794
2800
|
end
|
2795
2801
|
|
2796
2802
|
class Countries
|
@@ -2872,24 +2878,6 @@ module Io
|
|
2872
2878
|
|
2873
2879
|
end
|
2874
2880
|
|
2875
|
-
class Timezones
|
2876
|
-
|
2877
|
-
def initialize(client)
|
2878
|
-
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
2879
|
-
end
|
2880
|
-
|
2881
|
-
# Returns a list of timezones.
|
2882
|
-
def get(incoming={})
|
2883
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
2884
|
-
query = {
|
2885
|
-
:q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
|
2886
|
-
}.delete_if { |k, v| v.nil? }
|
2887
|
-
r = @client.request("/reference/timezones").with_query(query).get
|
2888
|
-
r.map { |x| ::Io::Flow::V0::Models::Timezone.new(x) }
|
2889
|
-
end
|
2890
|
-
|
2891
|
-
end
|
2892
|
-
|
2893
2881
|
class Documents
|
2894
2882
|
|
2895
2883
|
def initialize(client)
|
@@ -4027,6 +4015,86 @@ module Io
|
|
4027
4015
|
|
4028
4016
|
end
|
4029
4017
|
|
4018
|
+
class AuthorizationDeclineCode
|
4019
|
+
|
4020
|
+
attr_reader :value
|
4021
|
+
|
4022
|
+
def initialize(value)
|
4023
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
4024
|
+
end
|
4025
|
+
|
4026
|
+
# Returns the instance of AuthorizationDeclineCode for this value, creating a new instance for an unknown value
|
4027
|
+
def AuthorizationDeclineCode.apply(value)
|
4028
|
+
if value.instance_of?(AuthorizationDeclineCode)
|
4029
|
+
value
|
4030
|
+
else
|
4031
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
4032
|
+
value.nil? ? nil : (from_string(value) || AuthorizationDeclineCode.new(value))
|
4033
|
+
end
|
4034
|
+
end
|
4035
|
+
|
4036
|
+
# Returns the instance of AuthorizationDeclineCode for this value, or nil if not found
|
4037
|
+
def AuthorizationDeclineCode.from_string(value)
|
4038
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
4039
|
+
AuthorizationDeclineCode.ALL.find { |v| v.value == value }
|
4040
|
+
end
|
4041
|
+
|
4042
|
+
def AuthorizationDeclineCode.ALL
|
4043
|
+
@@all ||= [AuthorizationDeclineCode.expired, AuthorizationDeclineCode.invalid_number, AuthorizationDeclineCode.invalid_expiration, AuthorizationDeclineCode.no_account, AuthorizationDeclineCode.avs, AuthorizationDeclineCode.cvv, AuthorizationDeclineCode.fraud, AuthorizationDeclineCode.duplicate, AuthorizationDeclineCode.unknown]
|
4044
|
+
end
|
4045
|
+
|
4046
|
+
# Payment method has expired
|
4047
|
+
def AuthorizationDeclineCode.expired
|
4048
|
+
@@_expired ||= AuthorizationDeclineCode.new('expired')
|
4049
|
+
end
|
4050
|
+
|
4051
|
+
# Invalid payment number
|
4052
|
+
def AuthorizationDeclineCode.invalid_number
|
4053
|
+
@@_invalid_number ||= AuthorizationDeclineCode.new('invalid_number')
|
4054
|
+
end
|
4055
|
+
|
4056
|
+
# Invalid expiration date
|
4057
|
+
def AuthorizationDeclineCode.invalid_expiration
|
4058
|
+
@@_invalid_expiration ||= AuthorizationDeclineCode.new('invalid_expiration')
|
4059
|
+
end
|
4060
|
+
|
4061
|
+
# The provided payment method is not known by the issuing bank (the account does
|
4062
|
+
# not exist)
|
4063
|
+
def AuthorizationDeclineCode.no_account
|
4064
|
+
@@_no_account ||= AuthorizationDeclineCode.new('no_account')
|
4065
|
+
end
|
4066
|
+
|
4067
|
+
# Declined due to avs mismatch)
|
4068
|
+
def AuthorizationDeclineCode.avs
|
4069
|
+
@@_avs ||= AuthorizationDeclineCode.new('avs')
|
4070
|
+
end
|
4071
|
+
|
4072
|
+
# Declined due to cvv mismatch)
|
4073
|
+
def AuthorizationDeclineCode.cvv
|
4074
|
+
@@_cvv ||= AuthorizationDeclineCode.new('cvv')
|
4075
|
+
end
|
4076
|
+
|
4077
|
+
# Declined due to suspected fraud
|
4078
|
+
def AuthorizationDeclineCode.fraud
|
4079
|
+
@@_fraud ||= AuthorizationDeclineCode.new('fraud')
|
4080
|
+
end
|
4081
|
+
|
4082
|
+
# Declined due to suspected duplicate transaction
|
4083
|
+
def AuthorizationDeclineCode.duplicate
|
4084
|
+
@@_duplicate ||= AuthorizationDeclineCode.new('duplicate')
|
4085
|
+
end
|
4086
|
+
|
4087
|
+
# Declined due to another reason (details not known)
|
4088
|
+
def AuthorizationDeclineCode.unknown
|
4089
|
+
@@_unknown ||= AuthorizationDeclineCode.new('unknown')
|
4090
|
+
end
|
4091
|
+
|
4092
|
+
def to_hash
|
4093
|
+
value
|
4094
|
+
end
|
4095
|
+
|
4096
|
+
end
|
4097
|
+
|
4030
4098
|
class AuthorizationStatus
|
4031
4099
|
|
4032
4100
|
attr_reader :value
|
@@ -4052,24 +4120,37 @@ module Io
|
|
4052
4120
|
end
|
4053
4121
|
|
4054
4122
|
def AuthorizationStatus.ALL
|
4055
|
-
@@all ||= [AuthorizationStatus.
|
4123
|
+
@@all ||= [AuthorizationStatus.pending, AuthorizationStatus.pending_call_bank, AuthorizationStatus.authorized, AuthorizationStatus.declined, AuthorizationStatus.voided]
|
4124
|
+
end
|
4125
|
+
|
4126
|
+
# If an immediate response is not available, the state will be 'pending' - this
|
4127
|
+
# usually indicates fraud review requires additional time / verification (or a
|
4128
|
+
# potential network issue with the issuing bank)
|
4129
|
+
def AuthorizationStatus.pending
|
4130
|
+
@@_pending ||= AuthorizationStatus.new('pending')
|
4131
|
+
end
|
4132
|
+
|
4133
|
+
# Bank is requesting consumer contact them directly to authorize the transaction
|
4134
|
+
def AuthorizationStatus.pending_call_bank
|
4135
|
+
@@_pending_call_bank ||= AuthorizationStatus.new('pending_call_bank')
|
4056
4136
|
end
|
4057
4137
|
|
4058
4138
|
# Authorization was successful
|
4059
|
-
def AuthorizationStatus.
|
4060
|
-
@@
|
4139
|
+
def AuthorizationStatus.authorized
|
4140
|
+
@@_authorized ||= AuthorizationStatus.new('authorized')
|
4061
4141
|
end
|
4062
4142
|
|
4063
|
-
#
|
4143
|
+
# Indicates the authorization has been declined by the issuing bank. See the
|
4144
|
+
# authorization decline code for more details as to the reason for decline.
|
4064
4145
|
def AuthorizationStatus.declined
|
4065
4146
|
@@_declined ||= AuthorizationStatus.new('declined')
|
4066
4147
|
end
|
4067
4148
|
|
4068
|
-
#
|
4069
|
-
#
|
4070
|
-
#
|
4071
|
-
def AuthorizationStatus.
|
4072
|
-
@@
|
4149
|
+
# Indicates the authorization has been voided. You can void an authorization up
|
4150
|
+
# until the moment you capture funds; once you have captured funds you must
|
4151
|
+
# create refunds.
|
4152
|
+
def AuthorizationStatus.voided
|
4153
|
+
@@_voided ||= AuthorizationStatus.new('voided')
|
4073
4154
|
end
|
4074
4155
|
|
4075
4156
|
def to_hash
|
@@ -6217,19 +6298,19 @@ module Io
|
|
6217
6298
|
|
6218
6299
|
end
|
6219
6300
|
|
6220
|
-
# Contains the result of the authorization.
|
6221
|
-
# end in a status of 'accepted' or 'declined'. If an immediate response is not
|
6301
|
+
# Contains the result of the authorization. If an immediate response is not
|
6222
6302
|
# available, the state will be 'pending' - this usually indicates fraud review
|
6223
6303
|
# requires additional time / verification (or a potential network issue with the
|
6224
6304
|
# issuing bank).
|
6225
6305
|
class AuthorizationResult
|
6226
6306
|
|
6227
|
-
attr_reader :status, :avs, :cvv
|
6307
|
+
attr_reader :status, :decline_code, :avs, :cvv
|
6228
6308
|
|
6229
6309
|
def initialize(incoming={})
|
6230
6310
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6231
6311
|
HttpClient::Preconditions.require_keys(opts, [:status], 'AuthorizationResult')
|
6232
6312
|
@status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::AuthorizationStatus) ? x : ::Io::Flow::V0::Models::AuthorizationStatus.apply(x))
|
6313
|
+
@decline_code = (x = opts.delete(:decline_code); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::AuthorizationDeclineCode) ? x : ::Io::Flow::V0::Models::AuthorizationDeclineCode.apply(x)))
|
6233
6314
|
@avs = (x = opts.delete(:avs); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Avs) ? x : ::Io::Flow::V0::Models::Avs.new(x)))
|
6234
6315
|
@cvv = (x = opts.delete(:cvv); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Cvv) ? x : ::Io::Flow::V0::Models::Cvv.new(x)))
|
6235
6316
|
end
|
@@ -6245,6 +6326,7 @@ module Io
|
|
6245
6326
|
def to_hash
|
6246
6327
|
{
|
6247
6328
|
:status => status.value,
|
6329
|
+
:decline_code => decline_code.nil? ? nil : decline_code.value,
|
6248
6330
|
:avs => avs.nil? ? nil : avs.to_hash,
|
6249
6331
|
:cvv => cvv.nil? ? nil : cvv.to_hash
|
6250
6332
|
}
|
@@ -6319,9 +6401,9 @@ module Io
|
|
6319
6401
|
|
6320
6402
|
def initialize(incoming={})
|
6321
6403
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6322
|
-
HttpClient::Preconditions.require_keys(opts, [:code
|
6404
|
+
HttpClient::Preconditions.require_keys(opts, [:code], 'Avs')
|
6323
6405
|
@code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::AvsCode) ? x : ::Io::Flow::V0::Models::AvsCode.apply(x))
|
6324
|
-
@description = HttpClient::Preconditions.assert_class('description',
|
6406
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
6325
6407
|
end
|
6326
6408
|
|
6327
6409
|
def to_json
|
@@ -6488,7 +6570,7 @@ module Io
|
|
6488
6570
|
|
6489
6571
|
class CardForm
|
6490
6572
|
|
6491
|
-
attr_reader :number, :cipher, :expiration_month, :expiration_year, :name, :cvv, :address
|
6573
|
+
attr_reader :number, :cipher, :expiration_month, :expiration_year, :name, :cvv, :address, :challenge
|
6492
6574
|
|
6493
6575
|
def initialize(incoming={})
|
6494
6576
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -6500,6 +6582,7 @@ module Io
|
|
6500
6582
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
6501
6583
|
@cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
|
6502
6584
|
@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)))
|
6585
|
+
@challenge = (x = opts.delete(:challenge); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Challenge) ? x : ::Io::Flow::V0::Models::Challenge.new(x)))
|
6503
6586
|
end
|
6504
6587
|
|
6505
6588
|
def to_json
|
@@ -6518,7 +6601,8 @@ module Io
|
|
6518
6601
|
:expiration_year => expiration_year,
|
6519
6602
|
:name => name,
|
6520
6603
|
:cvv => cvv,
|
6521
|
-
:address => address.nil? ? nil : address.to_hash
|
6604
|
+
:address => address.nil? ? nil : address.to_hash,
|
6605
|
+
:challenge => challenge.nil? ? nil : challenge.to_hash
|
6522
6606
|
}
|
6523
6607
|
end
|
6524
6608
|
|
@@ -7139,6 +7223,36 @@ module Io
|
|
7139
7223
|
|
7140
7224
|
end
|
7141
7225
|
|
7226
|
+
# Challenge provides a text string and an encryption of that string which is
|
7227
|
+
# used server side to verify that encryption worked as expected.
|
7228
|
+
class Challenge
|
7229
|
+
|
7230
|
+
attr_reader :text, :cipher
|
7231
|
+
|
7232
|
+
def initialize(incoming={})
|
7233
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7234
|
+
HttpClient::Preconditions.require_keys(opts, [:text, :cipher], 'Challenge')
|
7235
|
+
@text = HttpClient::Preconditions.assert_class('text', opts.delete(:text), String)
|
7236
|
+
@cipher = HttpClient::Preconditions.assert_class('cipher', opts.delete(:cipher), String)
|
7237
|
+
end
|
7238
|
+
|
7239
|
+
def to_json
|
7240
|
+
JSON.dump(to_hash)
|
7241
|
+
end
|
7242
|
+
|
7243
|
+
def copy(incoming={})
|
7244
|
+
Challenge.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
7245
|
+
end
|
7246
|
+
|
7247
|
+
def to_hash
|
7248
|
+
{
|
7249
|
+
:text => text,
|
7250
|
+
:cipher => cipher
|
7251
|
+
}
|
7252
|
+
end
|
7253
|
+
|
7254
|
+
end
|
7255
|
+
|
7142
7256
|
# The actual value of the API token. This is modeled as a separate resource as
|
7143
7257
|
# it is fetched only on demand.
|
7144
7258
|
class Cleartext
|
@@ -7417,9 +7531,9 @@ module Io
|
|
7417
7531
|
|
7418
7532
|
def initialize(incoming={})
|
7419
7533
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7420
|
-
HttpClient::Preconditions.require_keys(opts, [:code
|
7534
|
+
HttpClient::Preconditions.require_keys(opts, [:code], 'Cvv')
|
7421
7535
|
@code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::CvvCode) ? x : ::Io::Flow::V0::Models::CvvCode.apply(x))
|
7422
|
-
@description = HttpClient::Preconditions.assert_class('description',
|
7536
|
+
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
7423
7537
|
end
|
7424
7538
|
|
7425
7539
|
def to_json
|
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.45
|
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-08-
|
11
|
+
date: 2016-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|