flowcommerce 0.0.36 → 0.0.37
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 +420 -130
- 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: bc545183d957a7e6192c44e19893081674206952
|
4
|
+
data.tar.gz: 5b64383fadfdf0ad48a3e2c36f47cc616af4ba18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a03d75af24a4c0eb6244ecc3bcbb8c95423e5c5b6910d183f566a0c3a68453725d445470c15eaabecb0900e070a491d79e1cfe02048dd08911a663aac2252ce8
|
7
|
+
data.tar.gz: ec40aab28cd35b086022b1f7d9771ae2fcec0fbbf1b53e43ba974106f1babae16ee8207ea3f5604ec4a177c44628cbfc92261e68967558168e00c5d0f0cd6bd2
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.1.
|
3
|
-
# apidoc:0.11.33 http://www.apidoc.me/flow/api/0.1.
|
2
|
+
# Service version: 0.1.8
|
3
|
+
# apidoc:0.11.33 http://www.apidoc.me/flow/api/0.1.7/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.33 http://www.apidoc.me/flow/api/0.1.
|
29
|
-
VERSION = '0.1.
|
28
|
+
USER_AGENT = 'apidoc:0.11.33 http://www.apidoc.me/flow/api/0.1.7/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.1.8' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -555,6 +555,7 @@ module Io
|
|
555
555
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
556
556
|
query = {
|
557
557
|
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
|
558
|
+
:status => (x = opts.delete(:status); x.nil? ? nil : HttpClient::Preconditions.assert_class('status', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::SubcatalogItemStatus) ? x : ::Io::Flow::V0::Models::SubcatalogItemStatus.apply(x)).value }),
|
558
559
|
:experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
|
559
560
|
:country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)),
|
560
561
|
:ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
|
@@ -1073,6 +1074,7 @@ module Io
|
|
1073
1074
|
query = {
|
1074
1075
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1075
1076
|
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
|
1077
|
+
:status => (x = opts.delete(:status); x.nil? ? nil : HttpClient::Preconditions.assert_class('status', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::SubcatalogItemStatus) ? x : ::Io::Flow::V0::Models::SubcatalogItemStatus.apply(x)).value }),
|
1076
1078
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1077
1079
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1078
1080
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String),
|
@@ -1099,6 +1101,7 @@ module Io
|
|
1099
1101
|
query = {
|
1100
1102
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1101
1103
|
:number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
|
1104
|
+
:status => (x = opts.delete(:status); x.nil? ? nil : HttpClient::Preconditions.assert_class('status', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::SubcatalogItemStatus) ? x : ::Io::Flow::V0::Models::SubcatalogItemStatus.apply(x)).value }),
|
1102
1105
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1103
1106
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1104
1107
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
@@ -1622,7 +1625,7 @@ module Io
|
|
1622
1625
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1623
1626
|
query = {
|
1624
1627
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1625
|
-
:
|
1628
|
+
:key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
|
1626
1629
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1627
1630
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1628
1631
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
@@ -1640,19 +1643,19 @@ module Io
|
|
1640
1643
|
end
|
1641
1644
|
|
1642
1645
|
# Returns information about a specific authorization.
|
1643
|
-
def
|
1646
|
+
def get_by_key(organization, key)
|
1644
1647
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1645
|
-
HttpClient::Preconditions.assert_class('
|
1646
|
-
r = @client.request("/#{CGI.escape(organization)}/authorizations/#{CGI.escape(
|
1648
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
1649
|
+
r = @client.request("/#{CGI.escape(organization)}/authorizations/#{CGI.escape(key)}").get
|
1647
1650
|
::Io::Flow::V0::Models::Authorization.new(r)
|
1648
1651
|
end
|
1649
1652
|
|
1650
1653
|
# Deletes a given authorization. This method will return a 422 if funds have
|
1651
1654
|
# already been captured.
|
1652
|
-
def
|
1655
|
+
def delete_by_key(organization, key)
|
1653
1656
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1654
|
-
HttpClient::Preconditions.assert_class('
|
1655
|
-
r = @client.request("/#{CGI.escape(organization)}/authorizations/#{CGI.escape(
|
1657
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
1658
|
+
r = @client.request("/#{CGI.escape(organization)}/authorizations/#{CGI.escape(key)}").delete
|
1656
1659
|
nil
|
1657
1660
|
end
|
1658
1661
|
|
@@ -1684,9 +1687,9 @@ module Io
|
|
1684
1687
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1685
1688
|
query = {
|
1686
1689
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1687
|
-
:
|
1690
|
+
:key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
|
1688
1691
|
:authorization_id => (x = opts.delete(:authorization_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_id', x, String)),
|
1689
|
-
:
|
1692
|
+
:authorization_key => (x = opts.delete(:authorization_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_key', x, String)),
|
1690
1693
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1691
1694
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1692
1695
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
@@ -1704,10 +1707,10 @@ module Io
|
|
1704
1707
|
end
|
1705
1708
|
|
1706
1709
|
# Returns information about a specific capture.
|
1707
|
-
def
|
1710
|
+
def get_by_key(organization, key)
|
1708
1711
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1709
|
-
HttpClient::Preconditions.assert_class('
|
1710
|
-
r = @client.request("/#{CGI.escape(organization)}/captures/#{CGI.escape(
|
1712
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
1713
|
+
r = @client.request("/#{CGI.escape(organization)}/captures/#{CGI.escape(key)}").get
|
1711
1714
|
::Io::Flow::V0::Models::Capture.new(r)
|
1712
1715
|
end
|
1713
1716
|
|
@@ -1739,6 +1742,7 @@ module Io
|
|
1739
1742
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1740
1743
|
query = {
|
1741
1744
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1745
|
+
:token => (x = opts.delete(:token); x.nil? ? nil : HttpClient::Preconditions.assert_class('token', x, Array).map { |v| HttpClient::Preconditions.assert_class('token', v, String) }),
|
1742
1746
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1743
1747
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1744
1748
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
@@ -1756,31 +1760,31 @@ module Io
|
|
1756
1760
|
end
|
1757
1761
|
|
1758
1762
|
# Returns information about a specific card.
|
1759
|
-
def
|
1763
|
+
def get_by_token(organization, token)
|
1760
1764
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1761
|
-
HttpClient::Preconditions.assert_class('
|
1762
|
-
r = @client.request("/#{CGI.escape(organization)}/cards/#{CGI.escape(
|
1765
|
+
HttpClient::Preconditions.assert_class('token', token, String)
|
1766
|
+
r = @client.request("/#{CGI.escape(organization)}/cards/#{CGI.escape(token)}").get
|
1763
1767
|
::Io::Flow::V0::Models::Card.new(r)
|
1764
1768
|
end
|
1765
1769
|
|
1766
|
-
# Deletes the
|
1767
|
-
def
|
1770
|
+
# Deletes the specified card
|
1771
|
+
def delete_by_token(organization, token)
|
1768
1772
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1769
|
-
HttpClient::Preconditions.assert_class('
|
1770
|
-
r = @client.request("/#{CGI.escape(organization)}/cards/#{CGI.escape(
|
1773
|
+
HttpClient::Preconditions.assert_class('token', token, String)
|
1774
|
+
r = @client.request("/#{CGI.escape(organization)}/cards/#{CGI.escape(token)}").delete
|
1771
1775
|
nil
|
1772
1776
|
end
|
1773
1777
|
|
1774
1778
|
# Updates are implemented as copy on write. This method is a convenience
|
1775
|
-
# method that will transactionally DELETE the card with the specified
|
1776
|
-
# CREATE a new card with the data from this request. Note that this means
|
1777
|
-
# returned credit card token will be DIFFERENT from the one used in the
|
1779
|
+
# method that will transactionally DELETE the card with the specified token,
|
1780
|
+
# then CREATE a new card with the data from this request. Note that this means
|
1781
|
+
# the returned credit card token will be DIFFERENT from the one used in the
|
1778
1782
|
# request.
|
1779
|
-
def
|
1783
|
+
def post_updates_by_token(organization, token, card_form)
|
1780
1784
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1781
|
-
HttpClient::Preconditions.assert_class('
|
1785
|
+
HttpClient::Preconditions.assert_class('token', token, String)
|
1782
1786
|
HttpClient::Preconditions.assert_class('card_form', card_form, ::Io::Flow::V0::Models::CardForm)
|
1783
|
-
r = @client.request("/#{CGI.escape(organization)}/cards/#{CGI.escape(
|
1787
|
+
r = @client.request("/#{CGI.escape(organization)}/cards/#{CGI.escape(token)}/updates").with_json(card_form.to_json).post
|
1784
1788
|
::Io::Flow::V0::Models::Card.new(r)
|
1785
1789
|
end
|
1786
1790
|
|
@@ -1791,6 +1795,7 @@ module Io
|
|
1791
1795
|
query = {
|
1792
1796
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1793
1797
|
:card_id => (x = opts.delete(:card_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('card_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('card_id', v, String) }),
|
1798
|
+
:card_token => (x = opts.delete(:card_token); x.nil? ? nil : HttpClient::Preconditions.assert_class('card_token', x, Array).map { |v| HttpClient::Preconditions.assert_class('card_token', v, String) }),
|
1794
1799
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1795
1800
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1796
1801
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
@@ -1812,11 +1817,11 @@ module Io
|
|
1812
1817
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1813
1818
|
query = {
|
1814
1819
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
1815
|
-
:
|
1820
|
+
:key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
|
1816
1821
|
:authorization_id => (x = opts.delete(:authorization_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_id', x, String)),
|
1817
|
-
:
|
1822
|
+
:authorization_key => (x = opts.delete(:authorization_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('authorization_key', x, String)),
|
1818
1823
|
:capture_id => (x = opts.delete(:capture_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('capture_id', x, String)),
|
1819
|
-
:
|
1824
|
+
:capture_key => (x = opts.delete(:capture_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('capture_key', x, String)),
|
1820
1825
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
1821
1826
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
1822
1827
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
@@ -1834,10 +1839,10 @@ module Io
|
|
1834
1839
|
end
|
1835
1840
|
|
1836
1841
|
# Returns information about a specific refund.
|
1837
|
-
def
|
1842
|
+
def get_by_key(organization, key)
|
1838
1843
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
1839
|
-
HttpClient::Preconditions.assert_class('
|
1840
|
-
r = @client.request("/#{CGI.escape(organization)}/refunds/#{CGI.escape(
|
1844
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
1845
|
+
r = @client.request("/#{CGI.escape(organization)}/refunds/#{CGI.escape(key)}").get
|
1841
1846
|
::Io::Flow::V0::Models::Refund.new(r)
|
1842
1847
|
end
|
1843
1848
|
|
@@ -3488,6 +3493,59 @@ module Io
|
|
3488
3493
|
|
3489
3494
|
end
|
3490
3495
|
|
3496
|
+
# Flow provides several different options for creating an authorization
|
3497
|
+
class AuthorizationForm
|
3498
|
+
|
3499
|
+
module Types
|
3500
|
+
DIRECT_AUTHORIZATION_FORM = 'direct_authorization_form' unless defined?(DIRECT_AUTHORIZATION_FORM)
|
3501
|
+
MERCHANT_OF_RECORD_AUTHORIZATION_FORM = 'merchant_of_record_authorization_form' unless defined?(MERCHANT_OF_RECORD_AUTHORIZATION_FORM)
|
3502
|
+
end
|
3503
|
+
|
3504
|
+
def initialize(incoming={})
|
3505
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3506
|
+
HttpClient::Preconditions.require_keys(opts, [:name], 'AuthorizationForm')
|
3507
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
3508
|
+
end
|
3509
|
+
|
3510
|
+
def to_hash
|
3511
|
+
subtype_to_hash.merge(:discriminator => @name)
|
3512
|
+
end
|
3513
|
+
|
3514
|
+
def AuthorizationForm.from_json(hash)
|
3515
|
+
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
3516
|
+
case HttpClient::Helper.symbolize_keys(hash)[:discriminator]
|
3517
|
+
when Types::DIRECT_AUTHORIZATION_FORM; DirectAuthorizationForm.new(hash)
|
3518
|
+
when Types::MERCHANT_OF_RECORD_AUTHORIZATION_FORM; MerchantOfRecordAuthorizationForm.new(hash)
|
3519
|
+
else AuthorizationFormUndefinedType.new(:name => union_type_name)
|
3520
|
+
end
|
3521
|
+
end
|
3522
|
+
|
3523
|
+
end
|
3524
|
+
|
3525
|
+
class AuthorizationFormUndefinedType < AuthorizationForm
|
3526
|
+
|
3527
|
+
attr_reader :name
|
3528
|
+
|
3529
|
+
def initialize(incoming={})
|
3530
|
+
super(:name => 'undefined_type')
|
3531
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3532
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
3533
|
+
end
|
3534
|
+
|
3535
|
+
def subtype_to_hash
|
3536
|
+
raise 'Unable to serialize undefined type to json'
|
3537
|
+
end
|
3538
|
+
|
3539
|
+
def copy(incoming={})
|
3540
|
+
raise 'Operation not supported for undefined type'
|
3541
|
+
end
|
3542
|
+
|
3543
|
+
def to_hash
|
3544
|
+
raise 'Operation not supported for undefined type'
|
3545
|
+
end
|
3546
|
+
|
3547
|
+
end
|
3548
|
+
|
3491
3549
|
class Deminimus
|
3492
3550
|
|
3493
3551
|
module Types
|
@@ -3617,6 +3675,8 @@ module Io
|
|
3617
3675
|
HS10_CODE_DELETED = 'hs10_code_deleted' unless defined?(HS10_CODE_DELETED)
|
3618
3676
|
LOCALIZED_ITEM_UPSERTED = 'localized_item_upserted' unless defined?(LOCALIZED_ITEM_UPSERTED)
|
3619
3677
|
LOCALIZED_ITEM_DELETED = 'localized_item_deleted' unless defined?(LOCALIZED_ITEM_DELETED)
|
3678
|
+
ORGANIZATION_UPSERTED = 'organization_upserted' unless defined?(ORGANIZATION_UPSERTED)
|
3679
|
+
ORGANIZATION_DELETED = 'organization_deleted' unless defined?(ORGANIZATION_DELETED)
|
3620
3680
|
end
|
3621
3681
|
|
3622
3682
|
def initialize(incoming={})
|
@@ -3656,6 +3716,8 @@ module Io
|
|
3656
3716
|
when Types::HS10_CODE_DELETED; Hs10CodeDeleted.new(hash)
|
3657
3717
|
when Types::LOCALIZED_ITEM_UPSERTED; LocalizedItemUpserted.new(hash)
|
3658
3718
|
when Types::LOCALIZED_ITEM_DELETED; LocalizedItemDeleted.new(hash)
|
3719
|
+
when Types::ORGANIZATION_UPSERTED; OrganizationUpserted.new(hash)
|
3720
|
+
when Types::ORGANIZATION_DELETED; OrganizationDeleted.new(hash)
|
3659
3721
|
else EventUndefinedType.new(:name => union_type_name)
|
3660
3722
|
end
|
3661
3723
|
end
|
@@ -4020,6 +4082,55 @@ module Io
|
|
4020
4082
|
|
4021
4083
|
end
|
4022
4084
|
|
4085
|
+
class AvsCode
|
4086
|
+
|
4087
|
+
attr_reader :value
|
4088
|
+
|
4089
|
+
def initialize(value)
|
4090
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
4091
|
+
end
|
4092
|
+
|
4093
|
+
# Returns the instance of AvsCode for this value, creating a new instance for an unknown value
|
4094
|
+
def AvsCode.apply(value)
|
4095
|
+
if value.instance_of?(AvsCode)
|
4096
|
+
value
|
4097
|
+
else
|
4098
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
4099
|
+
value.nil? ? nil : (from_string(value) || AvsCode.new(value))
|
4100
|
+
end
|
4101
|
+
end
|
4102
|
+
|
4103
|
+
# Returns the instance of AvsCode for this value, or nil if not found
|
4104
|
+
def AvsCode.from_string(value)
|
4105
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
4106
|
+
AvsCode.ALL.find { |v| v.value == value }
|
4107
|
+
end
|
4108
|
+
|
4109
|
+
def AvsCode.ALL
|
4110
|
+
@@all ||= [AvsCode.match, AvsCode.no_match, AvsCode.not_supported]
|
4111
|
+
end
|
4112
|
+
|
4113
|
+
# Address matches expected values
|
4114
|
+
def AvsCode.match
|
4115
|
+
@@_match ||= AvsCode.new('match')
|
4116
|
+
end
|
4117
|
+
|
4118
|
+
# Address does not match expected card values
|
4119
|
+
def AvsCode.no_match
|
4120
|
+
@@_no_match ||= AvsCode.new('no_match')
|
4121
|
+
end
|
4122
|
+
|
4123
|
+
# Issuer does not support address verification
|
4124
|
+
def AvsCode.not_supported
|
4125
|
+
@@_not_supported ||= AvsCode.new('not_supported')
|
4126
|
+
end
|
4127
|
+
|
4128
|
+
def to_hash
|
4129
|
+
value
|
4130
|
+
end
|
4131
|
+
|
4132
|
+
end
|
4133
|
+
|
4023
4134
|
class Calendar
|
4024
4135
|
|
4025
4136
|
attr_reader :value
|
@@ -4210,6 +4321,55 @@ module Io
|
|
4210
4321
|
|
4211
4322
|
end
|
4212
4323
|
|
4324
|
+
class CvvCode
|
4325
|
+
|
4326
|
+
attr_reader :value
|
4327
|
+
|
4328
|
+
def initialize(value)
|
4329
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
4330
|
+
end
|
4331
|
+
|
4332
|
+
# Returns the instance of CvvCode for this value, creating a new instance for an unknown value
|
4333
|
+
def CvvCode.apply(value)
|
4334
|
+
if value.instance_of?(CvvCode)
|
4335
|
+
value
|
4336
|
+
else
|
4337
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
4338
|
+
value.nil? ? nil : (from_string(value) || CvvCode.new(value))
|
4339
|
+
end
|
4340
|
+
end
|
4341
|
+
|
4342
|
+
# Returns the instance of CvvCode for this value, or nil if not found
|
4343
|
+
def CvvCode.from_string(value)
|
4344
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
4345
|
+
CvvCode.ALL.find { |v| v.value == value }
|
4346
|
+
end
|
4347
|
+
|
4348
|
+
def CvvCode.ALL
|
4349
|
+
@@all ||= [CvvCode.match, CvvCode.no_match, CvvCode.not_supported]
|
4350
|
+
end
|
4351
|
+
|
4352
|
+
# CVV matches
|
4353
|
+
def CvvCode.match
|
4354
|
+
@@_match ||= CvvCode.new('match')
|
4355
|
+
end
|
4356
|
+
|
4357
|
+
# CVV did not match
|
4358
|
+
def CvvCode.no_match
|
4359
|
+
@@_no_match ||= CvvCode.new('no_match')
|
4360
|
+
end
|
4361
|
+
|
4362
|
+
# Issuer does not support card verification numbers
|
4363
|
+
def CvvCode.not_supported
|
4364
|
+
@@_not_supported ||= CvvCode.new('not_supported')
|
4365
|
+
end
|
4366
|
+
|
4367
|
+
def to_hash
|
4368
|
+
value
|
4369
|
+
end
|
4370
|
+
|
4371
|
+
end
|
4372
|
+
|
4213
4373
|
class DeliveredDuty
|
4214
4374
|
|
4215
4375
|
attr_reader :value
|
@@ -4329,7 +4489,7 @@ module Io
|
|
4329
4489
|
end
|
4330
4490
|
|
4331
4491
|
def EventType.ALL
|
4332
|
-
@@all ||= [EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.flow_currency_setting_deleted, EventType.flow_currency_setting_upserted, EventType.rate_deleted, EventType.rate_upserted, EventType.spot_rate_deleted, EventType.spot_rate_upserted, EventType.organization_currency_setting_deleted, EventType.organization_currency_setting_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted]
|
4492
|
+
@@all ||= [EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.flow_currency_setting_deleted, EventType.flow_currency_setting_upserted, EventType.rate_deleted, EventType.rate_upserted, EventType.spot_rate_deleted, EventType.spot_rate_upserted, EventType.organization_currency_setting_deleted, EventType.organization_currency_setting_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.organization_upserted, EventType.organization_deleted]
|
4333
4493
|
end
|
4334
4494
|
|
4335
4495
|
def EventType.catalog_upserted
|
@@ -4428,6 +4588,14 @@ module Io
|
|
4428
4588
|
@@_localized_item_deleted ||= EventType.new('localized_item_deleted')
|
4429
4589
|
end
|
4430
4590
|
|
4591
|
+
def EventType.organization_upserted
|
4592
|
+
@@_organization_upserted ||= EventType.new('organization_upserted')
|
4593
|
+
end
|
4594
|
+
|
4595
|
+
def EventType.organization_deleted
|
4596
|
+
@@_organization_deleted ||= EventType.new('organization_deleted')
|
4597
|
+
end
|
4598
|
+
|
4431
4599
|
def to_hash
|
4432
4600
|
value
|
4433
4601
|
end
|
@@ -5963,13 +6131,13 @@ module Io
|
|
5963
6131
|
# capture up to the amount of the authorization.
|
5964
6132
|
class Authorization
|
5965
6133
|
|
5966
|
-
attr_reader :id, :
|
6134
|
+
attr_reader :id, :key, :card, :amount, :currency, :customer, :attributes, :shipping, :ip, :cvv, :details
|
5967
6135
|
|
5968
6136
|
def initialize(incoming={})
|
5969
6137
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
5970
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :card, :amount, :currency, :customer, :attributes, :details], 'Authorization')
|
6138
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :key, :card, :amount, :currency, :customer, :attributes, :details], 'Authorization')
|
5971
6139
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
5972
|
-
@
|
6140
|
+
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
5973
6141
|
@card = (x = opts.delete(:card); x.is_a?(::Io::Flow::V0::Models::CardReference) ? x : ::Io::Flow::V0::Models::CardReference.new(x))
|
5974
6142
|
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
5975
6143
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
@@ -5992,7 +6160,7 @@ module Io
|
|
5992
6160
|
def to_hash
|
5993
6161
|
{
|
5994
6162
|
:id => id,
|
5995
|
-
:
|
6163
|
+
:key => key,
|
5996
6164
|
:card => card.to_hash,
|
5997
6165
|
:amount => amount,
|
5998
6166
|
:currency => currency,
|
@@ -6068,51 +6236,6 @@ module Io
|
|
6068
6236
|
|
6069
6237
|
end
|
6070
6238
|
|
6071
|
-
# An authorization is used to check and reserve funds w/ a given payment method.
|
6072
|
-
# No funds are actually transferred; once you have you an authorization, you can
|
6073
|
-
# capture up to the amount of the authorization.
|
6074
|
-
class AuthorizationForm
|
6075
|
-
|
6076
|
-
attr_reader :reference, :token, :amount, :currency, :customer, :cvv, :attributes, :shipping, :ip
|
6077
|
-
|
6078
|
-
def initialize(incoming={})
|
6079
|
-
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6080
|
-
HttpClient::Preconditions.require_keys(opts, [:token, :amount, :currency, :customer], 'AuthorizationForm')
|
6081
|
-
@reference = (x = opts.delete(:reference); x.nil? ? nil : HttpClient::Preconditions.assert_class('reference', x, String))
|
6082
|
-
@token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
|
6083
|
-
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
6084
|
-
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
6085
|
-
@customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
|
6086
|
-
@cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
|
6087
|
-
@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 })
|
6088
|
-
@shipping = (x = opts.delete(:shipping); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
|
6089
|
-
@ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
|
6090
|
-
end
|
6091
|
-
|
6092
|
-
def to_json
|
6093
|
-
JSON.dump(to_hash)
|
6094
|
-
end
|
6095
|
-
|
6096
|
-
def copy(incoming={})
|
6097
|
-
AuthorizationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
6098
|
-
end
|
6099
|
-
|
6100
|
-
def to_hash
|
6101
|
-
{
|
6102
|
-
:reference => reference,
|
6103
|
-
:token => token,
|
6104
|
-
:amount => amount,
|
6105
|
-
:currency => currency,
|
6106
|
-
:customer => customer.to_hash,
|
6107
|
-
:cvv => cvv,
|
6108
|
-
:attributes => attributes.nil? ? nil : attributes,
|
6109
|
-
:shipping => shipping.nil? ? nil : shipping.to_hash,
|
6110
|
-
:ip => ip
|
6111
|
-
}
|
6112
|
-
end
|
6113
|
-
|
6114
|
-
end
|
6115
|
-
|
6116
6239
|
class AuthorizationReference
|
6117
6240
|
|
6118
6241
|
attr_reader :id
|
@@ -6199,16 +6322,16 @@ module Io
|
|
6199
6322
|
|
6200
6323
|
end
|
6201
6324
|
|
6202
|
-
# Represents
|
6325
|
+
# Represents the address verification results
|
6203
6326
|
class Avs
|
6204
6327
|
|
6205
|
-
attr_reader :code, :
|
6328
|
+
attr_reader :code, :description
|
6206
6329
|
|
6207
6330
|
def initialize(incoming={})
|
6208
6331
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6209
|
-
HttpClient::Preconditions.require_keys(opts, [:code, :
|
6210
|
-
@code =
|
6211
|
-
@
|
6332
|
+
HttpClient::Preconditions.require_keys(opts, [:code, :description], 'Avs')
|
6333
|
+
@code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::AvsCode) ? x : ::Io::Flow::V0::Models::AvsCode.apply(x))
|
6334
|
+
@description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
|
6212
6335
|
end
|
6213
6336
|
|
6214
6337
|
def to_json
|
@@ -6221,8 +6344,8 @@ module Io
|
|
6221
6344
|
|
6222
6345
|
def to_hash
|
6223
6346
|
{
|
6224
|
-
:code => code,
|
6225
|
-
:
|
6347
|
+
:code => code.value,
|
6348
|
+
:description => description
|
6226
6349
|
}
|
6227
6350
|
end
|
6228
6351
|
|
@@ -6355,13 +6478,13 @@ module Io
|
|
6355
6478
|
# authorization otherwise becomes unavailable (e.g. expires).
|
6356
6479
|
class Capture
|
6357
6480
|
|
6358
|
-
attr_reader :id, :
|
6481
|
+
attr_reader :id, :key, :authorization, :amount, :currency
|
6359
6482
|
|
6360
6483
|
def initialize(incoming={})
|
6361
6484
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6362
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :authorization, :amount, :currency], 'Capture')
|
6485
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :key, :authorization, :amount, :currency], 'Capture')
|
6363
6486
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
6364
|
-
@
|
6487
|
+
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
6365
6488
|
@authorization = (x = opts.delete(:authorization); x.is_a?(::Io::Flow::V0::Models::AuthorizationReference) ? x : ::Io::Flow::V0::Models::AuthorizationReference.new(x))
|
6366
6489
|
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
6367
6490
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
@@ -6378,7 +6501,7 @@ module Io
|
|
6378
6501
|
def to_hash
|
6379
6502
|
{
|
6380
6503
|
:id => id,
|
6381
|
-
:
|
6504
|
+
:key => key,
|
6382
6505
|
:authorization => authorization.to_hash,
|
6383
6506
|
:amount => amount,
|
6384
6507
|
:currency => currency
|
@@ -6392,13 +6515,13 @@ module Io
|
|
6392
6515
|
# authorization otherwise becomes unavailable (e.g. expires).
|
6393
6516
|
class CaptureForm
|
6394
6517
|
|
6395
|
-
attr_reader :
|
6518
|
+
attr_reader :authorization_id, :key, :amount, :currency
|
6396
6519
|
|
6397
6520
|
def initialize(incoming={})
|
6398
6521
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6399
6522
|
HttpClient::Preconditions.require_keys(opts, [:authorization_id], 'CaptureForm')
|
6400
|
-
@reference = (x = opts.delete(:reference); x.nil? ? nil : HttpClient::Preconditions.assert_class('reference', x, String))
|
6401
6523
|
@authorization_id = HttpClient::Preconditions.assert_class('authorization_id', opts.delete(:authorization_id), String)
|
6524
|
+
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
6402
6525
|
@amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
6403
6526
|
@currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
6404
6527
|
end
|
@@ -6413,8 +6536,8 @@ module Io
|
|
6413
6536
|
|
6414
6537
|
def to_hash
|
6415
6538
|
{
|
6416
|
-
:reference => reference,
|
6417
6539
|
:authorization_id => authorization_id,
|
6540
|
+
:key => key,
|
6418
6541
|
:amount => amount,
|
6419
6542
|
:currency => currency
|
6420
6543
|
}
|
@@ -6454,17 +6577,18 @@ module Io
|
|
6454
6577
|
|
6455
6578
|
end
|
6456
6579
|
|
6457
|
-
# Card represents the metadata about a secure, tokenized card. The card '
|
6458
|
-
# a unique, cryptographically secure token by which this card can be
|
6459
|
-
# in the future.
|
6580
|
+
# Card represents the metadata about a secure, tokenized card. The card 'token'
|
6581
|
+
# is a unique, cryptographically secure token by which this card can be
|
6582
|
+
# identified in the future.
|
6460
6583
|
class Card
|
6461
6584
|
|
6462
|
-
attr_reader :id, :type, :expiration, :last4, :name, :address
|
6585
|
+
attr_reader :id, :token, :type, :expiration, :last4, :name, :address
|
6463
6586
|
|
6464
6587
|
def initialize(incoming={})
|
6465
6588
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6466
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :type, :expiration, :last4, :name], 'Card')
|
6589
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :token, :type, :expiration, :last4, :name], 'Card')
|
6467
6590
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
6591
|
+
@token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
|
6468
6592
|
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::CardType) ? x : ::Io::Flow::V0::Models::CardType.apply(x))
|
6469
6593
|
@expiration = (x = opts.delete(:expiration); x.is_a?(::Io::Flow::V0::Models::Expiration) ? x : ::Io::Flow::V0::Models::Expiration.new(x))
|
6470
6594
|
@last4 = HttpClient::Preconditions.assert_class('last4', opts.delete(:last4), String)
|
@@ -6483,6 +6607,7 @@ module Io
|
|
6483
6607
|
def to_hash
|
6484
6608
|
{
|
6485
6609
|
:id => id,
|
6610
|
+
:token => token,
|
6486
6611
|
:type => type.value,
|
6487
6612
|
:expiration => expiration.to_hash,
|
6488
6613
|
:last4 => last4,
|
@@ -6529,12 +6654,13 @@ module Io
|
|
6529
6654
|
|
6530
6655
|
class CardReference
|
6531
6656
|
|
6532
|
-
attr_reader :id
|
6657
|
+
attr_reader :id, :token
|
6533
6658
|
|
6534
6659
|
def initialize(incoming={})
|
6535
6660
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
6536
|
-
HttpClient::Preconditions.require_keys(opts, [:id], 'CardReference')
|
6661
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :token], 'CardReference')
|
6537
6662
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
6663
|
+
@token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
|
6538
6664
|
end
|
6539
6665
|
|
6540
6666
|
def to_json
|
@@ -6547,7 +6673,8 @@ module Io
|
|
6547
6673
|
|
6548
6674
|
def to_hash
|
6549
6675
|
{
|
6550
|
-
:id => id
|
6676
|
+
:id => id,
|
6677
|
+
:token => token
|
6551
6678
|
}
|
6552
6679
|
end
|
6553
6680
|
|
@@ -6997,13 +7124,13 @@ module Io
|
|
6997
7124
|
|
6998
7125
|
def initialize(incoming={})
|
6999
7126
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7000
|
-
HttpClient::Preconditions.require_keys(opts, [:address, :packaging, :name, :services, :schedule
|
7127
|
+
HttpClient::Preconditions.require_keys(opts, [:address, :packaging, :name, :services, :schedule], 'CenterForm')
|
7001
7128
|
@address = (x = opts.delete(:address); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
|
7002
7129
|
@packaging = HttpClient::Preconditions.assert_class('packaging', opts.delete(:packaging), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Packaging) ? x : ::Io::Flow::V0::Models::Packaging.new(x)) }
|
7003
7130
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
7004
7131
|
@services = HttpClient::Preconditions.assert_class('services', opts.delete(:services), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AvailableService) ? x : ::Io::Flow::V0::Models::AvailableService.new(x)) }
|
7005
7132
|
@schedule = (x = opts.delete(:schedule); x.is_a?(::Io::Flow::V0::Models::Schedule) ? x : ::Io::Flow::V0::Models::Schedule.new(x))
|
7006
|
-
@timezone = HttpClient::Preconditions.assert_class('timezone',
|
7133
|
+
@timezone = (x = opts.delete(:timezone); x.nil? ? nil : HttpClient::Preconditions.assert_class('timezone', x, String))
|
7007
7134
|
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
7008
7135
|
end
|
7009
7136
|
|
@@ -7119,12 +7246,13 @@ module Io
|
|
7119
7246
|
# contact person for an account, shipment, or organization representative
|
7120
7247
|
class Contact
|
7121
7248
|
|
7122
|
-
attr_reader :name, :email, :phone
|
7249
|
+
attr_reader :name, :company, :email, :phone
|
7123
7250
|
|
7124
7251
|
def initialize(incoming={})
|
7125
7252
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7126
7253
|
HttpClient::Preconditions.require_keys(opts, [:name], 'Contact')
|
7127
7254
|
@name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))
|
7255
|
+
@company = (x = opts.delete(:company); x.nil? ? nil : HttpClient::Preconditions.assert_class('company', x, String))
|
7128
7256
|
@email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String))
|
7129
7257
|
@phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
|
7130
7258
|
end
|
@@ -7140,6 +7268,7 @@ module Io
|
|
7140
7268
|
def to_hash
|
7141
7269
|
{
|
7142
7270
|
:name => name.to_hash,
|
7271
|
+
:company => company,
|
7143
7272
|
:email => email,
|
7144
7273
|
:phone => phone
|
7145
7274
|
}
|
@@ -7180,17 +7309,18 @@ module Io
|
|
7180
7309
|
|
7181
7310
|
class Country
|
7182
7311
|
|
7183
|
-
attr_reader :name, :iso_3166_2, :iso_3166_3, :languages, :measurement_system, :default_currency
|
7312
|
+
attr_reader :name, :iso_3166_2, :iso_3166_3, :languages, :measurement_system, :default_currency, :timezones
|
7184
7313
|
|
7185
7314
|
def initialize(incoming={})
|
7186
7315
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7187
|
-
HttpClient::Preconditions.require_keys(opts, [:name, :iso_3166_2, :iso_3166_3, :languages, :measurement_system], 'Country')
|
7316
|
+
HttpClient::Preconditions.require_keys(opts, [:name, :iso_3166_2, :iso_3166_3, :languages, :measurement_system, :timezones], 'Country')
|
7188
7317
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
7189
7318
|
@iso_3166_2 = HttpClient::Preconditions.assert_class('iso_3166_2', opts.delete(:iso_3166_2), String)
|
7190
7319
|
@iso_3166_3 = HttpClient::Preconditions.assert_class('iso_3166_3', opts.delete(:iso_3166_3), String)
|
7191
7320
|
@languages = HttpClient::Preconditions.assert_class('languages', opts.delete(:languages), Array).map { |v| HttpClient::Preconditions.assert_class('languages', v, String) }
|
7192
7321
|
@measurement_system = HttpClient::Preconditions.assert_class('measurement_system', opts.delete(:measurement_system), String)
|
7193
7322
|
@default_currency = (x = opts.delete(:default_currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_currency', x, String))
|
7323
|
+
@timezones = HttpClient::Preconditions.assert_class('timezones', opts.delete(:timezones), Array).map { |v| HttpClient::Preconditions.assert_class('timezones', v, String) }
|
7194
7324
|
end
|
7195
7325
|
|
7196
7326
|
def to_json
|
@@ -7208,7 +7338,8 @@ module Io
|
|
7208
7338
|
:iso_3166_3 => iso_3166_3,
|
7209
7339
|
:languages => languages,
|
7210
7340
|
:measurement_system => measurement_system,
|
7211
|
-
:default_currency => default_currency
|
7341
|
+
:default_currency => default_currency,
|
7342
|
+
:timezones => timezones
|
7212
7343
|
}
|
7213
7344
|
end
|
7214
7345
|
|
@@ -7315,16 +7446,16 @@ module Io
|
|
7315
7446
|
|
7316
7447
|
end
|
7317
7448
|
|
7318
|
-
# Represents
|
7449
|
+
# Represents the card verification results
|
7319
7450
|
class Cvv
|
7320
7451
|
|
7321
|
-
attr_reader :code, :
|
7452
|
+
attr_reader :code, :description
|
7322
7453
|
|
7323
7454
|
def initialize(incoming={})
|
7324
7455
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7325
|
-
HttpClient::Preconditions.require_keys(opts, [:code, :
|
7326
|
-
@code =
|
7327
|
-
@
|
7456
|
+
HttpClient::Preconditions.require_keys(opts, [:code, :description], 'Cvv')
|
7457
|
+
@code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::CvvCode) ? x : ::Io::Flow::V0::Models::CvvCode.apply(x))
|
7458
|
+
@description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
|
7328
7459
|
end
|
7329
7460
|
|
7330
7461
|
def to_json
|
@@ -7337,8 +7468,8 @@ module Io
|
|
7337
7468
|
|
7338
7469
|
def to_hash
|
7339
7470
|
{
|
7340
|
-
:code => code,
|
7341
|
-
:
|
7471
|
+
:code => code.value,
|
7472
|
+
:description => description
|
7342
7473
|
}
|
7343
7474
|
end
|
7344
7475
|
|
@@ -7785,6 +7916,53 @@ module Io
|
|
7785
7916
|
|
7786
7917
|
end
|
7787
7918
|
|
7919
|
+
# Creates an authorization for a transaction in which you remain the merchant of
|
7920
|
+
# record. An authorization is used to check and reserve funds w/ a given payment
|
7921
|
+
# method. No funds are actually transferred; once you have you an authorization,
|
7922
|
+
# you can capture up to the amount of the authorization.
|
7923
|
+
class DirectAuthorizationForm < AuthorizationForm
|
7924
|
+
|
7925
|
+
attr_reader :token, :amount, :currency, :customer, :key, :cvv, :attributes, :shipping, :ip
|
7926
|
+
|
7927
|
+
def initialize(incoming={})
|
7928
|
+
super(:name => AuthorizationForm::Types::DIRECT_AUTHORIZATION_FORM)
|
7929
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7930
|
+
HttpClient::Preconditions.require_keys(opts, [:token, :amount, :currency, :customer], 'DirectAuthorizationForm')
|
7931
|
+
@token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
|
7932
|
+
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
7933
|
+
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
7934
|
+
@customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
|
7935
|
+
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
7936
|
+
@cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
|
7937
|
+
@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 })
|
7938
|
+
@shipping = (x = opts.delete(:shipping); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
|
7939
|
+
@ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
|
7940
|
+
end
|
7941
|
+
|
7942
|
+
def to_json
|
7943
|
+
JSON.dump(to_hash)
|
7944
|
+
end
|
7945
|
+
|
7946
|
+
def copy(incoming={})
|
7947
|
+
DirectAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
7948
|
+
end
|
7949
|
+
|
7950
|
+
def subtype_to_hash
|
7951
|
+
{
|
7952
|
+
:token => token,
|
7953
|
+
:amount => amount,
|
7954
|
+
:currency => currency,
|
7955
|
+
:customer => customer.to_hash,
|
7956
|
+
:key => key,
|
7957
|
+
:cvv => cvv,
|
7958
|
+
:attributes => attributes.nil? ? nil : attributes,
|
7959
|
+
:shipping => shipping.nil? ? nil : shipping.to_hash,
|
7960
|
+
:ip => ip
|
7961
|
+
}
|
7962
|
+
end
|
7963
|
+
|
7964
|
+
end
|
7965
|
+
|
7788
7966
|
# Represents a duration of time.
|
7789
7967
|
class Duration
|
7790
7968
|
|
@@ -10960,6 +11138,48 @@ module Io
|
|
10960
11138
|
|
10961
11139
|
end
|
10962
11140
|
|
11141
|
+
# Creates an authorization for a transaction for which Flow is the merchant of
|
11142
|
+
# record. In this case, you must provide your order number for a valid Flow
|
11143
|
+
# order. An authorization is used to check and reserve funds w/ a given payment
|
11144
|
+
# method. No funds are actually transferred; once you have you an authorization,
|
11145
|
+
# you can capture up to the amount of the authorization
|
11146
|
+
class MerchantOfRecordAuthorizationForm < AuthorizationForm
|
11147
|
+
|
11148
|
+
attr_reader :token, :order_number, :key, :cvv, :attributes, :ip
|
11149
|
+
|
11150
|
+
def initialize(incoming={})
|
11151
|
+
super(:name => AuthorizationForm::Types::MERCHANT_OF_RECORD_AUTHORIZATION_FORM)
|
11152
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11153
|
+
HttpClient::Preconditions.require_keys(opts, [:token, :order_number], 'MerchantOfRecordAuthorizationForm')
|
11154
|
+
@token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
|
11155
|
+
@order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
|
11156
|
+
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
11157
|
+
@cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
|
11158
|
+
@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 })
|
11159
|
+
@ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
|
11160
|
+
end
|
11161
|
+
|
11162
|
+
def to_json
|
11163
|
+
JSON.dump(to_hash)
|
11164
|
+
end
|
11165
|
+
|
11166
|
+
def copy(incoming={})
|
11167
|
+
MerchantOfRecordAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11168
|
+
end
|
11169
|
+
|
11170
|
+
def subtype_to_hash
|
11171
|
+
{
|
11172
|
+
:token => token,
|
11173
|
+
:order_number => order_number,
|
11174
|
+
:key => key,
|
11175
|
+
:cvv => cvv,
|
11176
|
+
:attributes => attributes.nil? ? nil : attributes,
|
11177
|
+
:ip => ip
|
11178
|
+
}
|
11179
|
+
end
|
11180
|
+
|
11181
|
+
end
|
11182
|
+
|
10963
11183
|
# Money represents an amount in a given currency
|
10964
11184
|
class Money
|
10965
11185
|
|
@@ -11516,6 +11736,37 @@ module Io
|
|
11516
11736
|
|
11517
11737
|
end
|
11518
11738
|
|
11739
|
+
class OrganizationDeleted < Event
|
11740
|
+
|
11741
|
+
attr_reader :event_id, :timestamp, :id
|
11742
|
+
|
11743
|
+
def initialize(incoming={})
|
11744
|
+
super(:name => Event::Types::ORGANIZATION_DELETED)
|
11745
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11746
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id], 'OrganizationDeleted')
|
11747
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
11748
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
11749
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11750
|
+
end
|
11751
|
+
|
11752
|
+
def to_json
|
11753
|
+
JSON.dump(to_hash)
|
11754
|
+
end
|
11755
|
+
|
11756
|
+
def copy(incoming={})
|
11757
|
+
OrganizationDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11758
|
+
end
|
11759
|
+
|
11760
|
+
def subtype_to_hash
|
11761
|
+
{
|
11762
|
+
:event_id => event_id,
|
11763
|
+
:timestamp => timestamp,
|
11764
|
+
:id => id
|
11765
|
+
}
|
11766
|
+
end
|
11767
|
+
|
11768
|
+
end
|
11769
|
+
|
11519
11770
|
# Either id or name is required.
|
11520
11771
|
class OrganizationForm
|
11521
11772
|
|
@@ -11633,6 +11884,43 @@ module Io
|
|
11633
11884
|
|
11634
11885
|
end
|
11635
11886
|
|
11887
|
+
class OrganizationUpserted < Event
|
11888
|
+
|
11889
|
+
attr_reader :event_id, :timestamp, :id, :name, :environment, :parent_id
|
11890
|
+
|
11891
|
+
def initialize(incoming={})
|
11892
|
+
super(:name => Event::Types::ORGANIZATION_UPSERTED)
|
11893
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11894
|
+
HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :name, :environment], 'OrganizationUpserted')
|
11895
|
+
@event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
|
11896
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
11897
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11898
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
11899
|
+
@environment = HttpClient::Preconditions.assert_class('environment', opts.delete(:environment), String)
|
11900
|
+
@parent_id = (x = opts.delete(:parent_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent_id', x, String))
|
11901
|
+
end
|
11902
|
+
|
11903
|
+
def to_json
|
11904
|
+
JSON.dump(to_hash)
|
11905
|
+
end
|
11906
|
+
|
11907
|
+
def copy(incoming={})
|
11908
|
+
OrganizationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11909
|
+
end
|
11910
|
+
|
11911
|
+
def subtype_to_hash
|
11912
|
+
{
|
11913
|
+
:event_id => event_id,
|
11914
|
+
:timestamp => timestamp,
|
11915
|
+
:id => id,
|
11916
|
+
:name => name,
|
11917
|
+
:environment => environment,
|
11918
|
+
:parent_id => parent_id
|
11919
|
+
}
|
11920
|
+
end
|
11921
|
+
|
11922
|
+
end
|
11923
|
+
|
11636
11924
|
class OrganizationVersion
|
11637
11925
|
|
11638
11926
|
attr_reader :id, :timestamp, :type, :organization
|
@@ -12343,13 +12631,13 @@ module Io
|
|
12343
12631
|
# Refunds are used to issue refunds against a prior capture.
|
12344
12632
|
class Refund
|
12345
12633
|
|
12346
|
-
attr_reader :id, :
|
12634
|
+
attr_reader :id, :key, :capture, :amount, :currency
|
12347
12635
|
|
12348
12636
|
def initialize(incoming={})
|
12349
12637
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12350
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :capture, :amount, :currency], 'Refund')
|
12638
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :key, :capture, :amount, :currency], 'Refund')
|
12351
12639
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
12352
|
-
@
|
12640
|
+
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
12353
12641
|
@capture = (x = opts.delete(:capture); x.is_a?(::Io::Flow::V0::Models::Capture) ? x : ::Io::Flow::V0::Models::Capture.new(x))
|
12354
12642
|
@amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
|
12355
12643
|
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
@@ -12366,7 +12654,7 @@ module Io
|
|
12366
12654
|
def to_hash
|
12367
12655
|
{
|
12368
12656
|
:id => id,
|
12369
|
-
:
|
12657
|
+
:key => key,
|
12370
12658
|
:capture => capture.to_hash,
|
12371
12659
|
:amount => amount,
|
12372
12660
|
:currency => currency
|
@@ -12379,13 +12667,13 @@ module Io
|
|
12379
12667
|
# until the total amount of the capture has been refunded.
|
12380
12668
|
class RefundForm
|
12381
12669
|
|
12382
|
-
attr_reader :capture_id, :
|
12670
|
+
attr_reader :capture_id, :key, :amount, :currency
|
12383
12671
|
|
12384
12672
|
def initialize(incoming={})
|
12385
12673
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12386
12674
|
HttpClient::Preconditions.require_keys(opts, [:capture_id], 'RefundForm')
|
12387
12675
|
@capture_id = HttpClient::Preconditions.assert_class('capture_id', opts.delete(:capture_id), String)
|
12388
|
-
@
|
12676
|
+
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
12389
12677
|
@amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
|
12390
12678
|
@currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
|
12391
12679
|
end
|
@@ -12401,7 +12689,7 @@ module Io
|
|
12401
12689
|
def to_hash
|
12402
12690
|
{
|
12403
12691
|
:capture_id => capture_id,
|
12404
|
-
:
|
12692
|
+
:key => key,
|
12405
12693
|
:amount => amount,
|
12406
12694
|
:currency => currency
|
12407
12695
|
}
|
@@ -12445,17 +12733,18 @@ module Io
|
|
12445
12733
|
# continents or other political areas (like the Eurozone).
|
12446
12734
|
class Region
|
12447
12735
|
|
12448
|
-
attr_reader :id, :name, :countries, :currencies, :languages, :measurement_systems
|
12736
|
+
attr_reader :id, :name, :countries, :currencies, :languages, :measurement_systems, :timezones
|
12449
12737
|
|
12450
12738
|
def initialize(incoming={})
|
12451
12739
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12452
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :name, :countries, :currencies, :languages, :measurement_systems], 'Region')
|
12740
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :name, :countries, :currencies, :languages, :measurement_systems, :timezones], 'Region')
|
12453
12741
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
12454
12742
|
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
12455
12743
|
@countries = HttpClient::Preconditions.assert_class('countries', opts.delete(:countries), Array).map { |v| HttpClient::Preconditions.assert_class('countries', v, String) }
|
12456
12744
|
@currencies = HttpClient::Preconditions.assert_class('currencies', opts.delete(:currencies), Array).map { |v| HttpClient::Preconditions.assert_class('currencies', v, String) }
|
12457
12745
|
@languages = HttpClient::Preconditions.assert_class('languages', opts.delete(:languages), Array).map { |v| HttpClient::Preconditions.assert_class('languages', v, String) }
|
12458
12746
|
@measurement_systems = HttpClient::Preconditions.assert_class('measurement_systems', opts.delete(:measurement_systems), Array).map { |v| HttpClient::Preconditions.assert_class('measurement_systems', v, String) }
|
12747
|
+
@timezones = HttpClient::Preconditions.assert_class('timezones', opts.delete(:timezones), Array).map { |v| HttpClient::Preconditions.assert_class('timezones', v, String) }
|
12459
12748
|
end
|
12460
12749
|
|
12461
12750
|
def to_json
|
@@ -12473,7 +12762,8 @@ module Io
|
|
12473
12762
|
:countries => countries,
|
12474
12763
|
:currencies => currencies,
|
12475
12764
|
:languages => languages,
|
12476
|
-
:measurement_systems => measurement_systems
|
12765
|
+
:measurement_systems => measurement_systems,
|
12766
|
+
:timezones => timezones
|
12477
12767
|
}
|
12478
12768
|
end
|
12479
12769
|
|
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.37
|
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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|