tangocard-raas 1.1.2 → 2.2.1
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/LICENSE +28 -175
- data/README.md +38 -525
- data/lib/raas.rb +32 -19
- data/lib/raas/api_helper.rb +146 -54
- data/lib/raas/configuration.rb +22 -30
- data/lib/raas/controllers/accounts_controller.rb +146 -92
- data/lib/raas/controllers/base_controller.rb +32 -29
- data/lib/raas/controllers/catalog_controller.rb +31 -14
- data/lib/raas/controllers/customers_controller.rb +113 -72
- data/lib/raas/controllers/exchange_rates_controller.rb +40 -12
- data/lib/raas/controllers/fund_controller.rb +345 -0
- data/lib/raas/controllers/orders_controller.rb +166 -105
- data/lib/raas/controllers/status_controller.rb +31 -14
- data/lib/raas/exceptions/api_exception.rb +4 -2
- data/lib/raas/exceptions/raas_client_exception.rb +14 -12
- data/lib/raas/exceptions/raas_generic_exception.rb +9 -9
- data/lib/raas/exceptions/raas_server_exception.rb +14 -12
- data/lib/raas/http/auth/basic_auth.rb +7 -4
- data/lib/raas/http/faraday_client.rb +19 -7
- data/lib/raas/http/http_call_back.rb +11 -6
- data/lib/raas/http/http_client.rb +50 -32
- data/lib/raas/http/http_context.rb +5 -2
- data/lib/raas/http/http_method_enum.rb +6 -2
- data/lib/raas/http/http_request.rb +7 -3
- data/lib/raas/http/http_response.rb +3 -1
- data/lib/raas/models/account_model.rb +32 -23
- data/lib/raas/models/account_summary_model.rb +26 -17
- data/lib/raas/models/base_model.rb +11 -9
- data/lib/raas/models/billing_address_model.rb +105 -0
- data/lib/raas/models/brand_model.rb +39 -35
- data/lib/raas/models/catalog_model.rb +15 -13
- data/lib/raas/models/create_account_request_model.rb +14 -14
- data/lib/raas/models/create_credit_card_request_model.rb +96 -0
- data/lib/raas/models/create_customer_request_model.rb +12 -12
- data/lib/raas/models/create_order_request_model.rb +45 -35
- data/lib/raas/models/credit_card_model.rb +124 -0
- data/lib/raas/models/currency_breakdown_model.rb +18 -18
- data/lib/raas/models/customer_model.rb +24 -22
- data/lib/raas/models/deposit_request_model.rb +60 -0
- data/lib/raas/models/deposit_response_model.rb +80 -0
- data/lib/raas/models/exchange_rate_model.rb +18 -17
- data/lib/raas/models/exchange_rate_response_model.rb +17 -15
- data/lib/raas/models/full_name_email_model.rb +42 -0
- data/lib/raas/models/get_deposit_response_model.rb +80 -0
- data/lib/raas/models/get_orders_response_model.rb +16 -14
- data/lib/raas/models/item_model.rb +36 -34
- data/lib/raas/models/name_email_model.rb +14 -14
- data/lib/raas/models/new_credit_card_model.rb +51 -0
- data/lib/raas/models/order_model.rb +124 -92
- data/lib/raas/models/order_summary_model.rb +155 -0
- data/lib/raas/models/page_model.rb +16 -16
- data/lib/raas/models/raas_client_error_model.rb +16 -16
- data/lib/raas/models/raas_server_error_model.rb +12 -12
- data/lib/raas/models/resend_order_response_model.rb +11 -11
- data/lib/raas/models/reward_credential_model.rb +14 -14
- data/lib/raas/models/reward_model.rb +16 -14
- data/lib/raas/models/system_status_response_model.rb +10 -10
- data/lib/raas/models/unregister_credit_card_request_model.rb +51 -0
- data/lib/raas/models/unregister_credit_card_response_model.rb +53 -0
- data/lib/raas/raas_client.rb +36 -25
- data/test/controllers/controller_test_base.rb +31 -0
- data/test/controllers/test_accounts_controller.rb +79 -0
- data/test/controllers/test_catalog_controller.rb +65 -0
- data/test/controllers/test_customers_controller.rb +61 -0
- data/test/controllers/test_exchange_rates_controller.rb +35 -0
- data/test/controllers/test_fund_controller.rb +108 -0
- data/test/controllers/test_orders_controller.rb +86 -0
- data/test/controllers/test_status_controller.rb +27 -0
- data/test/http_response_catcher.rb +16 -0
- data/test/test_helper.rb +91 -0
- metadata +32 -10
@@ -0,0 +1,35 @@
|
|
1
|
+
# This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require_relative 'controller_test_base'
|
4
|
+
|
5
|
+
class ExchangeRatesControllerTests < ControllerTestBase
|
6
|
+
# Called only once for the class before any test has executed
|
7
|
+
def self.startup
|
8
|
+
self.controller = @@api_client.exchange_rates
|
9
|
+
end
|
10
|
+
|
11
|
+
# Tests if we can successfully retrieve exchange rates
|
12
|
+
def test_test_retrieve_exchange_rates()
|
13
|
+
|
14
|
+
# Perform the API call through the SDK function
|
15
|
+
result = self.class.controller.get_exchange_rates()
|
16
|
+
|
17
|
+
# Test response code
|
18
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
19
|
+
|
20
|
+
# Test whether the captured response is as we expected
|
21
|
+
assert_not_nil(result)
|
22
|
+
expected_body = JSON.parse(
|
23
|
+
'{"disclaimer":"Exchange rates are provided here for reference. They are up'\
|
24
|
+
'dated at least once a day and may have changed by time of order.","exchange'\
|
25
|
+
'Rates":[{"lastModifiedDate":"2018-04-19T13:00:14.291","rewardCurrency":"EUR'\
|
26
|
+
'","baseCurrency":"NZD","baseFx":0.59120},{"lastModifiedDate":"2018-04-19T13'\
|
27
|
+
':00:14.291","rewardCurrency":"USD","baseCurrency":"NZD","baseFx":0.73130},{'\
|
28
|
+
'"lastModifiedDate":"2018-04-19T13:00:14.230","rewardCurrency":"INR","baseCu'\
|
29
|
+
'rrency":"AUD","baseFx":51.29066}]}'
|
30
|
+
)
|
31
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
32
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require_relative 'controller_test_base'
|
4
|
+
|
5
|
+
class FundControllerTests < ControllerTestBase
|
6
|
+
# Called only once for the class before any test has executed
|
7
|
+
def self.startup
|
8
|
+
self.controller = @@api_client.fund
|
9
|
+
end
|
10
|
+
|
11
|
+
# Tests retrieving deposit information
|
12
|
+
def test_test_get_deposit()
|
13
|
+
# Parameters for the API call
|
14
|
+
deposit_id = 'RAD-180426-5407'
|
15
|
+
|
16
|
+
# Perform the API call through the SDK function
|
17
|
+
result = self.class.controller.get_deposit(deposit_id)
|
18
|
+
|
19
|
+
# Test response code
|
20
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
21
|
+
|
22
|
+
# Test whether the captured response is as we expected
|
23
|
+
assert_not_nil(result)
|
24
|
+
expected_body = JSON.parse(
|
25
|
+
'{"referenceDepositID":"RAD-180426-5407","amount":1.25,"amountCharged":1.29'\
|
26
|
+
',"feePercent":3.5,"createdDate":"2018-04-26T18:56:28.28Z","status":"SUCCESS'\
|
27
|
+
'","accountNumber":"A32386768"}'
|
28
|
+
)
|
29
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
30
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
31
|
+
end
|
32
|
+
|
33
|
+
# Tests adding funds to an account
|
34
|
+
def test_test_add_funds()
|
35
|
+
# Parameters for the API call
|
36
|
+
body = DepositRequestModel.from_hash(JSON.parse(
|
37
|
+
'{"accountIdentifier":"sdkautotest5","amount":1.25,"creditCardToken":"56ac1'\
|
38
|
+
'a30-6ba2-4047-9b8c-70f97a5502c5","customerIdentifier":"sdkautotest4"}'
|
39
|
+
))
|
40
|
+
|
41
|
+
# Perform the API call through the SDK function
|
42
|
+
result = self.class.controller.add_funds(body)
|
43
|
+
|
44
|
+
# Test response code
|
45
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
46
|
+
|
47
|
+
# Test whether the captured response is as we expected
|
48
|
+
assert_not_nil(result)
|
49
|
+
expected_body = JSON.parse(
|
50
|
+
'{"referenceDepositID":"RAD-180426-5407","amount":1.25,"amountCharged":1.29'\
|
51
|
+
',"feePercent":3.5,"createdDate":"2018-04-26T18:56:28.28Z","status":"SUCCESS'\
|
52
|
+
'","accountNumber":"A32386768"}'
|
53
|
+
)
|
54
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
55
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
56
|
+
end
|
57
|
+
|
58
|
+
# Tests retrieving all credit cards for a platform
|
59
|
+
def test_test_get_credit_cards()
|
60
|
+
|
61
|
+
# Perform the API call through the SDK function
|
62
|
+
result = self.class.controller.get_credit_cards()
|
63
|
+
|
64
|
+
# Test response code
|
65
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
66
|
+
|
67
|
+
# Test whether the captured response is as we expected
|
68
|
+
assert_not_nil(result)
|
69
|
+
expected_body = JSON.parse(
|
70
|
+
'[{"customerIdentifier":"sdkautotest4","accountIdentifier":"sdkautotest5","'\
|
71
|
+
'token":"56ac1a30-6ba2-4047-9b8c-70f97a5502c5","label":"SDK Auto Testing Car'\
|
72
|
+
'd 1","lastFourDigits":"4444","expirationDate":"2020-01","status":"ACTIVE","'\
|
73
|
+
'createdDate":"2018-04-26T18:52:17.575Z","activationDate":"2018-04-26T18:52:'\
|
74
|
+
'17.575Z","contactInformation":[{"fullName":"Test User","emailAddress":"test'\
|
75
|
+
'@example.com"},{"fullName":"Test Man Two","emailAddress":"test2@example.com'\
|
76
|
+
'"}],"accountNumber":"A32386768"}]'
|
77
|
+
)
|
78
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
79
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
80
|
+
end
|
81
|
+
|
82
|
+
# Tests retrieving a single credit card
|
83
|
+
def test_test_get_credit_card()
|
84
|
+
# Parameters for the API call
|
85
|
+
token = '56ac1a30-6ba2-4047-9b8c-70f97a5502c5'
|
86
|
+
|
87
|
+
# Perform the API call through the SDK function
|
88
|
+
result = self.class.controller.get_credit_card(token)
|
89
|
+
|
90
|
+
# Test response code
|
91
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
92
|
+
|
93
|
+
# Test whether the captured response is as we expected
|
94
|
+
assert_not_nil(result)
|
95
|
+
expected_body = JSON.parse(
|
96
|
+
'{"customerIdentifier":"sdkautotest4","accountIdentifier":"sdkautotest5","t'\
|
97
|
+
'oken":"56ac1a30-6ba2-4047-9b8c-70f97a5502c5","label":"SDK Auto Testing Card'\
|
98
|
+
' 1","lastFourDigits":"4444","expirationDate":"2020-01","status":"ACTIVE","c'\
|
99
|
+
'reatedDate":"2018-04-26T18:52:17.575Z","activationDate":"2018-04-26T18:52:1'\
|
100
|
+
'7.575Z","contactInformation":[{"fullName":"Test User","emailAddress":"test@'\
|
101
|
+
'example.com"},{"fullName":"Test Man Two","emailAddress":"test2@example.com"'\
|
102
|
+
'}],"accountNumber":"A32386768"}'
|
103
|
+
)
|
104
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
105
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require_relative 'controller_test_base'
|
4
|
+
|
5
|
+
class OrdersControllerTests < ControllerTestBase
|
6
|
+
# Called only once for the class before any test has executed
|
7
|
+
def self.startup
|
8
|
+
self.controller = @@api_client.orders
|
9
|
+
end
|
10
|
+
|
11
|
+
# Tests retrieving a single order
|
12
|
+
def test_test_get_order()
|
13
|
+
# Parameters for the API call
|
14
|
+
reference_order_id = 'RA180426-1401-64'
|
15
|
+
|
16
|
+
# Perform the API call through the SDK function
|
17
|
+
result = self.class.controller.get_order(reference_order_id)
|
18
|
+
|
19
|
+
# Test response code
|
20
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
21
|
+
|
22
|
+
# Test whether the captured response is as we expected
|
23
|
+
assert_not_nil(result)
|
24
|
+
expected_body = JSON.parse(
|
25
|
+
'{"referenceOrderID":"RA180426-1401-64","customerIdentifier":"sdkautotest4"'\
|
26
|
+
',"accountIdentifier":"sdkautotest5","accountNumber":"A32386768","amountChar'\
|
27
|
+
'ged":{"value":1,"currencyCode":"USD","total":1},"marginShare":{"value":0,"c'\
|
28
|
+
'urrencyCode":"USD"},"denomination":{"value":1,"currencyCode":"USD"},"utid":'\
|
29
|
+
'"U561593","rewardName":"Reward Link","sender":{"firstName":"","lastName":""'\
|
30
|
+
',"email":""},"recipient":{"email":"","firstName":"","lastName":""},"sendEma'\
|
31
|
+
'il":false,"status":"COMPLETE","createdAt":"2018-04-26T20:08:59.624Z","rewar'\
|
32
|
+
'd":{"credentials":{"Redemption URL":"https://sandbox.rewardlink.io/r/1/ed0H'\
|
33
|
+
'tzSblNV6oFddNnnlf68eXzGQoREvcxwxu_Vi5Wk"},"credentialList":[{"label":"Redem'\
|
34
|
+
'ption URL","value":"https://sandbox.rewardlink.io/r/1/ed0HtzSblNV6oFddNnnlf'\
|
35
|
+
'68eXzGQoREvcxwxu_Vi5Wk","type":"url"}],"redemptionInstructions":"<p>• '\
|
36
|
+
'Click on the redemption link above to activate your Reward Link.<br />\\r'\
|
37
|
+
'\\n• Next, you will be able to spend your balance on retail gift cards'\
|
38
|
+
'.</p>\\r\\n\\r\\n<p>If you don't want to spend your entire Reward Link '\
|
39
|
+
'value right away, save the email or URL and return via the redemption link '\
|
40
|
+
'- your value will be waiting to be spent. This allows you to store the bala'\
|
41
|
+
'nce to redeem at another time.</p>\\r\\n"}}'
|
42
|
+
)
|
43
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
44
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
45
|
+
end
|
46
|
+
|
47
|
+
# Tests placing an order with the minimum parameters required
|
48
|
+
def test_test_place_order_with_minimum_criteria()
|
49
|
+
# Parameters for the API call
|
50
|
+
body = CreateOrderRequestModel.from_hash(JSON.parse(
|
51
|
+
'{"accountIdentifier":"sdkautotest5","amount":1.00,"customerIdentifier":"sd'\
|
52
|
+
'kautotest4","sendEmail":false,"utid":"U561593"}'
|
53
|
+
))
|
54
|
+
|
55
|
+
# Perform the API call through the SDK function
|
56
|
+
result = self.class.controller.create_order(body)
|
57
|
+
|
58
|
+
# Test response code
|
59
|
+
assert_equal(@response_catcher.response.status_code, 201)
|
60
|
+
|
61
|
+
# Test whether the captured response is as we expected
|
62
|
+
assert_not_nil(result)
|
63
|
+
expected_body = JSON.parse(
|
64
|
+
'{"referenceOrderID":"RA180426-1401-64","customerIdentifier":"sdkautotest4"'\
|
65
|
+
',"accountIdentifier":"sdkautotest5","accountNumber":"A32386768","amountChar'\
|
66
|
+
'ged":{"value":1,"currencyCode":"USD","total":1},"marginShare":{"value":0,"c'\
|
67
|
+
'urrencyCode":"USD"},"denomination":{"value":1,"currencyCode":"USD"},"utid":'\
|
68
|
+
'"U561593","rewardName":"Reward Link","sender":{"firstName":"","lastName":""'\
|
69
|
+
',"email":""},"recipient":{"email":"","firstName":"","lastName":""},"sendEma'\
|
70
|
+
'il":false,"status":"COMPLETE","createdAt":"2018-04-26T20:08:59.624Z","rewar'\
|
71
|
+
'd":{"credentials":{"Redemption URL":"https://sandbox.rewardlink.io/r/1/ed0H'\
|
72
|
+
'tzSblNV6oFddNnnlf68eXzGQoREvcxwxu_Vi5Wk"},"credentialList":[{"label":"Redem'\
|
73
|
+
'ption URL","value":"https://sandbox.rewardlink.io/r/1/ed0HtzSblNV6oFddNnnlf'\
|
74
|
+
'68eXzGQoREvcxwxu_Vi5Wk","type":"url"}],"redemptionInstructions":"<p>• '\
|
75
|
+
'Click on the redemption link above to activate your Reward Link.<br />\\r'\
|
76
|
+
'\\n• Next, you will be able to spend your balance on retail gift cards'\
|
77
|
+
'.</p>\\r\\n\\r\\n<p>If you don't want to spend your entire Reward Link '\
|
78
|
+
'value right away, save the email or URL and return via the redemption link '\
|
79
|
+
'- your value will be waiting to be spent. This allows you to store the bala'\
|
80
|
+
'nce to redeem at another time.</p>\\r\\n"}}'
|
81
|
+
)
|
82
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
83
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require_relative 'controller_test_base'
|
4
|
+
|
5
|
+
class StatusControllerTests < ControllerTestBase
|
6
|
+
# Called only once for the class before any test has executed
|
7
|
+
def self.startup
|
8
|
+
self.controller = @@api_client.status
|
9
|
+
end
|
10
|
+
|
11
|
+
# Tests if we can retrieve the system status
|
12
|
+
def test_test_status_is_ok()
|
13
|
+
|
14
|
+
# Perform the API call through the SDK function
|
15
|
+
result = self.class.controller.get_system_status()
|
16
|
+
|
17
|
+
# Test response code
|
18
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
19
|
+
|
20
|
+
# Test whether the captured response is as we expected
|
21
|
+
assert_not_nil(result)
|
22
|
+
expected_body = JSON.parse('{"status":"UP"}')
|
23
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
24
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
class HttpResponseCatcher < Raas::HttpCallBack
|
4
|
+
attr_accessor :response
|
5
|
+
|
6
|
+
def on_before_request(request)
|
7
|
+
end
|
8
|
+
|
9
|
+
# Catching the response
|
10
|
+
def on_after_response(context)
|
11
|
+
@response = context.response
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
# This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require 'tempfile'
|
4
|
+
require 'open-uri'
|
5
|
+
|
6
|
+
class TestHelper
|
7
|
+
|
8
|
+
@cache = Hash.new
|
9
|
+
|
10
|
+
# Class method to compare the received headers with the expected headers.
|
11
|
+
# @param [Hash] A hash of expected headers (keys in lower case).
|
12
|
+
# @param [Hash] A hash of received headers.
|
13
|
+
# @param [Boolean, optional] A flag which determines if we allow extra headers.
|
14
|
+
def self.match_headers(expected_headers,
|
15
|
+
received_headers,
|
16
|
+
allow_extra: true)
|
17
|
+
return false if ((received_headers.length < expected_headers.length) ||
|
18
|
+
((allow_extra == false) && (received_headers.length > expected_headers.length)))
|
19
|
+
|
20
|
+
received_headers = Hash[received_headers.map{|k, v| [k.to_s.downcase, v]}]
|
21
|
+
expected_headers.each do |e_key, e_value|
|
22
|
+
return false unless received_headers.key?(e_key)
|
23
|
+
return false if ((e_value != nil) &&
|
24
|
+
(e_value != received_headers[e_key]))
|
25
|
+
end
|
26
|
+
|
27
|
+
return true
|
28
|
+
end
|
29
|
+
|
30
|
+
# Class method to compare the received body with the expected body.
|
31
|
+
# @param [Dynamic] The expected body.
|
32
|
+
# @param [Dynamic] The received body.
|
33
|
+
# @param [Boolean, optional] A flag which determines if we check values in dictionaries.
|
34
|
+
# @param [Boolean, optional] A flag which determines if we check the order of array elements.
|
35
|
+
# @param [Boolean, optional] A flag which determines if we check the count of array elements.
|
36
|
+
def self.match_body(expected_body,
|
37
|
+
received_body,
|
38
|
+
check_values: false,
|
39
|
+
check_order: false,
|
40
|
+
check_count: false)
|
41
|
+
if expected_body.instance_of? Hash
|
42
|
+
return false unless received_body.instance_of? Hash
|
43
|
+
for key in expected_body.keys
|
44
|
+
return false unless received_body.keys.include? key
|
45
|
+
if check_values or expected_body[key].instance_of? Hash
|
46
|
+
return false unless TestHelper.match_body(expected_body[key],
|
47
|
+
received_body[key],
|
48
|
+
check_values: check_values,
|
49
|
+
check_order: check_order,
|
50
|
+
check_count: check_count)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
elsif expected_body.instance_of? Array
|
54
|
+
return False unless received_body.instance_of? Array
|
55
|
+
if check_count == true && (expected_body.length != received_body.length)
|
56
|
+
return false
|
57
|
+
else
|
58
|
+
previous_matches = Array.new
|
59
|
+
expected_body.each.with_index do |expected_element, i|
|
60
|
+
matches = (received_body.map.with_index do |received_element, j|
|
61
|
+
j if TestHelper.match_body(expected_element,
|
62
|
+
received_element,
|
63
|
+
check_values: check_values,
|
64
|
+
check_order: check_order,
|
65
|
+
check_count: check_count)
|
66
|
+
end).compact
|
67
|
+
return false if matches.length == 0
|
68
|
+
if check_order == true
|
69
|
+
return false if (i != 0 && matches.map{|x| previous_matches.map{|y| y > x}.all?}.all?)
|
70
|
+
previous_matches = matches
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
elsif expected_body != received_body
|
75
|
+
return false
|
76
|
+
end
|
77
|
+
return true
|
78
|
+
end
|
79
|
+
|
80
|
+
# Class method which takes a URL, downloads the file (if not already downloaded
|
81
|
+
# for this test session) and returns the path of the file.
|
82
|
+
# @param [String] The URL of the required file.
|
83
|
+
def self.get_file(url)
|
84
|
+
unless @cache.keys.include? url
|
85
|
+
@cache[url] = Tempfile.new('APIMatic')
|
86
|
+
@cache[url].binmode
|
87
|
+
@cache[url].write(open(url, {ssl_ca_cert: Certifi.where}).read)
|
88
|
+
end
|
89
|
+
return @cache[url].path
|
90
|
+
end
|
91
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tangocard-raas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- APIMatic SDK Generator
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -93,9 +93,9 @@ dependencies:
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 1.2.2
|
95
95
|
description: With this RESTful API you can integrate a global reward or incentive
|
96
|
-
program into your app or platform. If you have any questions or if you
|
97
|
-
|
98
|
-
email:
|
96
|
+
program into your app or platform. If you have any questions or if you'd like to
|
97
|
+
receive your own credentials, please contact us at devsupport@tangocard.com.
|
98
|
+
email: support@apimatic.io
|
99
99
|
executables: []
|
100
100
|
extensions: []
|
101
101
|
extra_rdoc_files: []
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- lib/raas/controllers/catalog_controller.rb
|
111
111
|
- lib/raas/controllers/customers_controller.rb
|
112
112
|
- lib/raas/controllers/exchange_rates_controller.rb
|
113
|
+
- lib/raas/controllers/fund_controller.rb
|
113
114
|
- lib/raas/controllers/orders_controller.rb
|
114
115
|
- lib/raas/controllers/status_controller.rb
|
115
116
|
- lib/raas/exceptions/api_exception.rb
|
@@ -127,19 +128,28 @@ files:
|
|
127
128
|
- lib/raas/models/account_model.rb
|
128
129
|
- lib/raas/models/account_summary_model.rb
|
129
130
|
- lib/raas/models/base_model.rb
|
131
|
+
- lib/raas/models/billing_address_model.rb
|
130
132
|
- lib/raas/models/brand_model.rb
|
131
133
|
- lib/raas/models/catalog_model.rb
|
132
134
|
- lib/raas/models/create_account_request_model.rb
|
135
|
+
- lib/raas/models/create_credit_card_request_model.rb
|
133
136
|
- lib/raas/models/create_customer_request_model.rb
|
134
137
|
- lib/raas/models/create_order_request_model.rb
|
138
|
+
- lib/raas/models/credit_card_model.rb
|
135
139
|
- lib/raas/models/currency_breakdown_model.rb
|
136
140
|
- lib/raas/models/customer_model.rb
|
141
|
+
- lib/raas/models/deposit_request_model.rb
|
142
|
+
- lib/raas/models/deposit_response_model.rb
|
137
143
|
- lib/raas/models/exchange_rate_model.rb
|
138
144
|
- lib/raas/models/exchange_rate_response_model.rb
|
145
|
+
- lib/raas/models/full_name_email_model.rb
|
146
|
+
- lib/raas/models/get_deposit_response_model.rb
|
139
147
|
- lib/raas/models/get_orders_response_model.rb
|
140
148
|
- lib/raas/models/item_model.rb
|
141
149
|
- lib/raas/models/name_email_model.rb
|
150
|
+
- lib/raas/models/new_credit_card_model.rb
|
142
151
|
- lib/raas/models/order_model.rb
|
152
|
+
- lib/raas/models/order_summary_model.rb
|
143
153
|
- lib/raas/models/page_model.rb
|
144
154
|
- lib/raas/models/raas_client_error_model.rb
|
145
155
|
- lib/raas/models/raas_server_error_model.rb
|
@@ -147,10 +157,22 @@ files:
|
|
147
157
|
- lib/raas/models/reward_credential_model.rb
|
148
158
|
- lib/raas/models/reward_model.rb
|
149
159
|
- lib/raas/models/system_status_response_model.rb
|
160
|
+
- lib/raas/models/unregister_credit_card_request_model.rb
|
161
|
+
- lib/raas/models/unregister_credit_card_response_model.rb
|
150
162
|
- lib/raas/raas_client.rb
|
151
|
-
|
163
|
+
- test/controllers/controller_test_base.rb
|
164
|
+
- test/controllers/test_accounts_controller.rb
|
165
|
+
- test/controllers/test_catalog_controller.rb
|
166
|
+
- test/controllers/test_customers_controller.rb
|
167
|
+
- test/controllers/test_exchange_rates_controller.rb
|
168
|
+
- test/controllers/test_fund_controller.rb
|
169
|
+
- test/controllers/test_orders_controller.rb
|
170
|
+
- test/controllers/test_status_controller.rb
|
171
|
+
- test/http_response_catcher.rb
|
172
|
+
- test/test_helper.rb
|
173
|
+
homepage: https://apimatic.io
|
152
174
|
licenses:
|
153
|
-
-
|
175
|
+
- MIT
|
154
176
|
metadata: {}
|
155
177
|
post_install_message:
|
156
178
|
rdoc_options: []
|
@@ -168,8 +190,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
190
|
version: '0'
|
169
191
|
requirements: []
|
170
192
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.
|
193
|
+
rubygems_version: 2.5.2.3
|
172
194
|
signing_key:
|
173
195
|
specification_version: 4
|
174
|
-
summary:
|
196
|
+
summary: raas
|
175
197
|
test_files: []
|