currency_cloud 0.12.5 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -1
  3. data/currency_cloud.gemspec +9 -3
  4. data/lib/currency_cloud/balance.rb +5 -0
  5. data/lib/currency_cloud/funding_account.rb +8 -0
  6. data/lib/currency_cloud/margin_balance_top_up.rb +5 -0
  7. data/lib/currency_cloud/payment.rb +10 -0
  8. data/lib/currency_cloud/payment_fee_rule.rb +5 -0
  9. data/lib/currency_cloud/payment_tracking_info.rb +5 -0
  10. data/lib/currency_cloud/quote_payment_fee.rb +5 -0
  11. data/lib/currency_cloud/reference.rb +5 -0
  12. data/lib/currency_cloud/version.rb +2 -2
  13. data/lib/currency_cloud/withdrawal_account.rb +17 -0
  14. data/lib/currency_cloud/withdrawal_account_funds.rb +5 -0
  15. data/lib/currency_cloud/withdrawal_accounts.rb +6 -0
  16. data/spec/integration/actions_spec.rb +11 -0
  17. data/spec/integration/funding_account_spec.rb +33 -0
  18. data/spec/integration/payments_spec.rb +28 -0
  19. data/spec/integration/rates_spec.rb +8 -0
  20. data/spec/integration/reference_spec.rb +52 -3
  21. data/spec/integration/withdrawal_accounts_spec.rb +69 -0
  22. data/spec/support/vcr_cassettes/Accounts/can_retrieve_account_payment_charges_settings.yml +2 -2
  23. data/spec/support/vcr_cassettes/Accounts/can_update_account_payment_charges_settings.yml +2 -2
  24. data/spec/support/vcr_cassettes/Actions/can_top_up_margin_balance.yml +39 -0
  25. data/spec/support/vcr_cassettes/Conversions/can_cancel_conversion/with_notes/has_a_non-empty_notes_attribute.yml +3 -3
  26. data/spec/support/vcr_cassettes/Conversions/can_cancel_conversion/without_notes/has_a_empty_notes_attribute.yml +3 -3
  27. data/spec/support/vcr_cassettes/Conversions/can_cancellation_quote.yml +2 -2
  28. data/spec/support/vcr_cassettes/Conversions/can_date_change_conversion.yml +3 -3
  29. data/spec/support/vcr_cassettes/Conversions/can_retrieve_cancellation_quote.yml +3 -3
  30. data/spec/support/vcr_cassettes/Conversions/can_retrieve_date_change_quote.yml +3 -3
  31. data/spec/support/vcr_cassettes/Conversions/can_retrieve_profit_and_loss.yml +2 -2
  32. data/spec/support/vcr_cassettes/Conversions/can_split_conversion.yml +3 -3
  33. data/spec/support/vcr_cassettes/Conversions/can_split_history.yml +3 -3
  34. data/spec/support/vcr_cassettes/Conversions/can_split_preview.yml +3 -3
  35. data/spec/support/vcr_cassettes/FundingAccounts/can_find.yml +141 -0
  36. data/spec/support/vcr_cassettes/IBANs/can_IBANs_for_a_specific_subaccount.yml +2 -2
  37. data/spec/support/vcr_cassettes/IBANs/can_IBANs_for_subaccounts.yml +2 -2
  38. data/spec/support/vcr_cassettes/IBANs/can_find.yml +2 -2
  39. data/spec/support/vcr_cassettes/Payments/can_authorise/when_payment_ids_are_valid.yml +5 -5
  40. data/spec/support/vcr_cassettes/Payments/can_create.yml +3 -3
  41. data/spec/support/vcr_cassettes/Payments/can_get_the_submission.yml +4 -4
  42. data/spec/support/vcr_cassettes/Payments/can_retrieve_confirmation.yml +3 -3
  43. data/spec/support/vcr_cassettes/Payments/can_retrieve_payment_delivery_date.yml +2 -2
  44. data/spec/support/vcr_cassettes/Payments/can_retrieve_payment_tracking_info.yml +291 -0
  45. data/spec/support/vcr_cassettes/Payments/can_retrieve_quote_payment_fee.yml +115 -0
  46. data/spec/support/vcr_cassettes/Rates/can_provided_detailed_rate_with_conversion_date_preference.yml +68 -0
  47. data/spec/support/vcr_cassettes/Reference/can_retrieve_bank_details.yml +2 -2
  48. data/spec/support/vcr_cassettes/Reference/can_retrieve_beneficiary_required_details.yml +2 -2
  49. data/spec/support/vcr_cassettes/Reference/can_retrieve_conversion_dates.yml +253 -110
  50. data/spec/support/vcr_cassettes/Reference/can_retrieve_currencies.yml +2 -2
  51. data/spec/support/vcr_cassettes/Reference/can_retrieve_payer_required_details.yml +2 -2
  52. data/spec/support/vcr_cassettes/Reference/can_retrieve_payment_dates.yml +2 -2
  53. data/spec/support/vcr_cassettes/Reference/can_retrieve_payment_fee_rules.yml +225 -0
  54. data/spec/support/vcr_cassettes/Reference/can_retrieve_payment_purpose_codes.yml +2 -2
  55. data/spec/support/vcr_cassettes/Reference/can_retrieve_settlement_accounts.yml +2 -2
  56. data/spec/support/vcr_cassettes/Reports/can_create_conversions_report.yml +2 -2
  57. data/spec/support/vcr_cassettes/Reports/can_create_payments_report.yml +2 -2
  58. data/spec/support/vcr_cassettes/Reports/can_find_report_requests.yml +2 -2
  59. data/spec/support/vcr_cassettes/Reports/can_retrieve_report_request.yml +2 -2
  60. data/spec/support/vcr_cassettes/Transactions/can_retrieve_sender_details.yml +2 -2
  61. data/spec/support/vcr_cassettes/Transfers/can_create.yml +2 -2
  62. data/spec/support/vcr_cassettes/Transfers/can_find.yml +3 -3
  63. data/spec/support/vcr_cassettes/Transfers/can_retrieve.yml +3 -3
  64. data/spec/support/vcr_cassettes/VirtualAccounts/can_find.yml +2 -2
  65. data/spec/support/vcr_cassettes/VirtualAccounts/can_find_VANs_for_a_specific_subaccount.yml +2 -2
  66. data/spec/support/vcr_cassettes/VirtualAccounts/can_find_VANs_for_subaccounts.yml +2 -2
  67. data/spec/support/vcr_cassettes/WithdrawalAccounts/can_find_withdrawal_accounts.yml +133 -0
  68. data/spec/support/vcr_cassettes/WithdrawalAccounts/can_find_withdrawal_accounts2.yml +140 -0
  69. data/spec/support/vcr_cassettes/WithdrawalAccounts/can_pull_funds.yml +140 -0
  70. metadata +51 -33
  71. data/lib/currency_cloud/settlement.rb +0 -55
  72. data/spec/integration/settlements_spec.rb +0 -66
  73. data/spec/support/vcr_cassettes/Settlements/can_add_conversion.yml +0 -152
  74. data/spec/support/vcr_cassettes/Settlements/can_release.yml +0 -119
  75. data/spec/support/vcr_cassettes/Settlements/can_remove_conversion.yml +0 -119
  76. data/spec/support/vcr_cassettes/Settlements/can_unrelease.yml +0 -119
@@ -1,119 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://devapi.currencycloud.com/v2/authenticate/api
6
- body:
7
- encoding: UTF-8
8
- string: login_id=development%40currencycloud.com&api_key=deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
9
- headers:
10
- User-Agent:
11
- - CurrencyCloudSDK/2.0 Ruby/0.11.2
12
- response:
13
- status:
14
- code: 200
15
- message: OK
16
- headers:
17
- Date:
18
- - Mon, 16 Jul 2018 10:54:49 GMT
19
- Content-Type:
20
- - application/json;charset=utf-8
21
- Transfer-Encoding:
22
- - chunked
23
- Connection:
24
- - keep-alive
25
- Set-Cookie:
26
- - AWSALB=jdAOzpHYb0jEH3x6jJv3ou6pDeYk+sfljrQY7rdUBqQqrnsLrbZplMTSTrZ4mztZUSEEP2cX/JE4BJwN6d82VTq34utxO7Sc5vB4rrBNJNxqEinZsp70piF8rAWm;
27
- Expires=Mon, 23 Jul 2018 10:54:47 GMT; Path=/
28
- - __cfduid=d31bf943b43d3227f460b1ce7c3844fcb1531738487; expires=Tue, 16-Jul-19
29
- 10:54:47 GMT; path=/; domain=.currencycloud.com; HttpOnly
30
- Access-Control-Allow-Origin:
31
- - "*"
32
- X-Request-Id:
33
- - 3138a734-59e3-4376-809b-04a79b22929d
34
- Access-Control-Allow-Methods:
35
- - POST
36
- X-Content-Type-Options:
37
- - nosniff
38
- Vary:
39
- - Origin
40
- Access-Control-Allow-Headers:
41
- - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
42
- Expect-Ct:
43
- - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
44
- Server:
45
- - cloudflare
46
- Cf-Ray:
47
- - 43b3eeccad5dbc50-LHR
48
- body:
49
- encoding: UTF-8
50
- string: '{"auth_token":"deadbeefdeadbeefdeadbeefdeadbeef"}'
51
- http_version:
52
- recorded_at: Mon, 16 Jul 2018 10:54:49 GMT
53
- - request:
54
- method: get
55
- uri: https://devapi.currencycloud.com/v2/settlements/51c619e0-0256-40ad-afba-ca4114b936f9
56
- body:
57
- encoding: US-ASCII
58
- string: ''
59
- headers:
60
- X-Auth-Token:
61
- - deadbeefdeadbeefdeadbeefdeadbeef
62
- response:
63
- status:
64
- code: 200
65
- message: OK
66
- headers:
67
- Server:
68
- - nginx
69
- Date:
70
- - Mon, 04 May 2015 21:17:27 GMT
71
- Content-Type:
72
- - application/json;charset=utf-8
73
- Content-Length:
74
- - '396'
75
- Connection:
76
- - keep-alive
77
- X-Request-Id:
78
- - '2778832264358227281'
79
- X-Content-Type-Options:
80
- - nosniff
81
- body:
82
- encoding: UTF-8
83
- string: '{"id":"51c619e0-0256-40ad-afba-ca4114b936f9","status":"open","short_reference":"20150504-SHKTFD","type":"bulk","conversion_ids":["9bb4a49b-f959-402f-8bb8-4463b18d93c7"],"entries":[{"USD":{"receive_amount":"0.00","send_amount":"1512.00"}},{"GBP":{"receive_amount":"1000.00","send_amount":"0.00"}}],"created_at":"2015-05-04T21:14:48+00:00","updated_at":"2015-05-04T21:14:48+00:00","released_at":""}'
84
- http_version:
85
- recorded_at: Mon, 04 May 2015 21:17:27 GMT
86
- - request:
87
- method: post
88
- uri: https://devapi.currencycloud.com/v2/settlements/51c619e0-0256-40ad-afba-ca4114b936f9/release
89
- body:
90
- encoding: US-ASCII
91
- string: ''
92
- headers:
93
- X-Auth-Token:
94
- - deadbeefdeadbeefdeadbeefdeadbeef
95
- response:
96
- status:
97
- code: 200
98
- message: OK
99
- headers:
100
- Server:
101
- - nginx
102
- Date:
103
- - Mon, 04 May 2015 21:44:23 GMT
104
- Content-Type:
105
- - application/json;charset=utf-8
106
- Content-Length:
107
- - '425'
108
- Connection:
109
- - keep-alive
110
- X-Request-Id:
111
- - '2778845818645866210'
112
- X-Content-Type-Options:
113
- - nosniff
114
- body:
115
- encoding: UTF-8
116
- string: '{"id":"51c619e0-0256-40ad-afba-ca4114b936f9","status":"released","short_reference":"20150504-SHKTFD","type":"bulk","conversion_ids":["9bb4a49b-f959-402f-8bb8-4463b18d93c7"],"entries":[{"USD":{"receive_amount":"0.00","send_amount":"1512.00"}},{"GBP":{"receive_amount":"1000.00","send_amount":"0.00"}}],"created_at":"2015-05-04T21:14:48+00:00","updated_at":"2015-05-04T21:44:23+00:00","released_at":"2015-05-04T21:44:23+00:00"}'
117
- http_version:
118
- recorded_at: Mon, 04 May 2015 21:44:23 GMT
119
- recorded_with: VCR 3.0.3
@@ -1,119 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://devapi.currencycloud.com/v2/authenticate/api
6
- body:
7
- encoding: UTF-8
8
- string: login_id=development%40currencycloud.com&api_key=deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
9
- headers:
10
- User-Agent:
11
- - CurrencyCloudSDK/2.0 Ruby/0.11.2
12
- response:
13
- status:
14
- code: 200
15
- message: OK
16
- headers:
17
- Date:
18
- - Mon, 16 Jul 2018 10:54:47 GMT
19
- Content-Type:
20
- - application/json;charset=utf-8
21
- Transfer-Encoding:
22
- - chunked
23
- Connection:
24
- - keep-alive
25
- Set-Cookie:
26
- - AWSALB=RAeBFnE+35qBcuEU7OEqBdrIdVmaonKl86lfcHlAbI5b65Jx4mgsRbZH5rfBUz4Afr6kEEjozWSXUGtje7tMV3v93azFbYwfsS+f5BrhM1a9pPqyXU/8mYykUplv;
27
- Expires=Mon, 23 Jul 2018 10:54:46 GMT; Path=/
28
- - __cfduid=db28be0476eba7214b7f895c4b738315f1531738486; expires=Tue, 16-Jul-19
29
- 10:54:46 GMT; path=/; domain=.currencycloud.com; HttpOnly
30
- Access-Control-Allow-Origin:
31
- - "*"
32
- X-Request-Id:
33
- - 3f74a705-e1ca-4a77-b4bc-ae6114fed064
34
- Access-Control-Allow-Methods:
35
- - POST
36
- X-Content-Type-Options:
37
- - nosniff
38
- Vary:
39
- - Origin
40
- Access-Control-Allow-Headers:
41
- - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
42
- Expect-Ct:
43
- - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
44
- Server:
45
- - cloudflare
46
- Cf-Ray:
47
- - 43b3eec1c8c10a66-LHR
48
- body:
49
- encoding: UTF-8
50
- string: '{"auth_token":"deadbeefdeadbeefdeadbeefdeadbeef"}'
51
- http_version:
52
- recorded_at: Mon, 16 Jul 2018 10:54:47 GMT
53
- - request:
54
- method: get
55
- uri: https://devapi.currencycloud.com/v2/settlements/63eeef54-3531-4e65-827a-7d0f37503fcc
56
- body:
57
- encoding: US-ASCII
58
- string: ''
59
- headers:
60
- X-Auth-Token:
61
- - deadbeefdeadbeefdeadbeefdeadbeef
62
- response:
63
- status:
64
- code: 200
65
- message: OK
66
- headers:
67
- Server:
68
- - nginx
69
- Date:
70
- - Mon, 04 May 2015 21:10:09 GMT
71
- Content-Type:
72
- - application/json;charset=utf-8
73
- Content-Length:
74
- - '396'
75
- Connection:
76
- - keep-alive
77
- X-Request-Id:
78
- - '2778828587740391361'
79
- X-Content-Type-Options:
80
- - nosniff
81
- body:
82
- encoding: UTF-8
83
- string: '{"id":"63eeef54-3531-4e65-827a-7d0f37503fcc","status":"open","short_reference":"20150504-RKNNBH","type":"bulk","conversion_ids":["24d2ee7f-c7a3-4181-979e-9c58dbace992"],"entries":[{"GBP":{"receive_amount":"1000.00","send_amount":"0.00"}},{"USD":{"receive_amount":"0.00","send_amount":"1511.70"}}],"created_at":"2015-05-04T20:29:16+00:00","updated_at":"2015-05-04T20:40:56+00:00","released_at":""}'
84
- http_version:
85
- recorded_at: Mon, 04 May 2015 21:10:09 GMT
86
- - request:
87
- method: post
88
- uri: https://devapi.currencycloud.com/v2/settlements/63eeef54-3531-4e65-827a-7d0f37503fcc/remove_conversion
89
- body:
90
- encoding: UTF-8
91
- string: conversion_id=24d2ee7f-c7a3-4181-979e-9c58dbace992
92
- headers:
93
- X-Auth-Token:
94
- - deadbeefdeadbeefdeadbeefdeadbeef
95
- response:
96
- status:
97
- code: 200
98
- message: OK
99
- headers:
100
- Server:
101
- - nginx
102
- Date:
103
- - Mon, 04 May 2015 21:13:48 GMT
104
- Content-Type:
105
- - application/json;charset=utf-8
106
- Content-Length:
107
- - '243'
108
- Connection:
109
- - keep-alive
110
- X-Request-Id:
111
- - '2778830425365638278'
112
- X-Content-Type-Options:
113
- - nosniff
114
- body:
115
- encoding: UTF-8
116
- string: '{"id":"63eeef54-3531-4e65-827a-7d0f37503fcc","status":"open","short_reference":"20150504-RKNNBH","type":"bulk","conversion_ids":[],"entries":[],"created_at":"2015-05-04T20:29:16+00:00","updated_at":"2015-05-04T20:40:56+00:00","released_at":""}'
117
- http_version:
118
- recorded_at: Mon, 04 May 2015 21:13:48 GMT
119
- recorded_with: VCR 3.0.3
@@ -1,119 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://devapi.currencycloud.com/v2/authenticate/api
6
- body:
7
- encoding: UTF-8
8
- string: login_id=development%40currencycloud.com&api_key=deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
9
- headers:
10
- User-Agent:
11
- - CurrencyCloudSDK/2.0 Ruby/0.11.2
12
- response:
13
- status:
14
- code: 200
15
- message: OK
16
- headers:
17
- Date:
18
- - Mon, 16 Jul 2018 10:54:51 GMT
19
- Content-Type:
20
- - application/json;charset=utf-8
21
- Transfer-Encoding:
22
- - chunked
23
- Connection:
24
- - keep-alive
25
- Set-Cookie:
26
- - AWSALB=JMKHEYXaDNLS10e97ewAnj80P87gx5wfDejW/P83fN8Xz/IFpXOBUxo708Y60Yc6PQz78KYd6J90MTB7+hG3Sh06wT1sizBshQE1qT9nB7awDnRjkj3xwo7ocdB0;
27
- Expires=Mon, 23 Jul 2018 10:54:49 GMT; Path=/
28
- - __cfduid=d79fab298bb727188b424fa75840a70de1531738489; expires=Tue, 16-Jul-19
29
- 10:54:49 GMT; path=/; domain=.currencycloud.com; HttpOnly
30
- Access-Control-Allow-Origin:
31
- - "*"
32
- X-Request-Id:
33
- - 8c27e8d0-ce19-40c2-82e9-ee55f9c70594
34
- Access-Control-Allow-Methods:
35
- - POST
36
- X-Content-Type-Options:
37
- - nosniff
38
- Vary:
39
- - Origin
40
- Access-Control-Allow-Headers:
41
- - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
42
- Expect-Ct:
43
- - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
44
- Server:
45
- - cloudflare
46
- Cf-Ray:
47
- - 43b3eed759651377-LHR
48
- body:
49
- encoding: UTF-8
50
- string: '{"auth_token":"deadbeefdeadbeefdeadbeefdeadbeef"}'
51
- http_version:
52
- recorded_at: Mon, 16 Jul 2018 10:54:51 GMT
53
- - request:
54
- method: get
55
- uri: https://devapi.currencycloud.com/v2/settlements/51c619e0-0256-40ad-afba-ca4114b936f9
56
- body:
57
- encoding: US-ASCII
58
- string: ''
59
- headers:
60
- X-Auth-Token:
61
- - deadbeefdeadbeefdeadbeefdeadbeef
62
- response:
63
- status:
64
- code: 200
65
- message: OK
66
- headers:
67
- Server:
68
- - nginx
69
- Date:
70
- - Mon, 04 May 2015 21:50:54 GMT
71
- Content-Type:
72
- - application/json;charset=utf-8
73
- Content-Length:
74
- - '425'
75
- Connection:
76
- - keep-alive
77
- X-Request-Id:
78
- - '2778849099396898860'
79
- X-Content-Type-Options:
80
- - nosniff
81
- body:
82
- encoding: UTF-8
83
- string: '{"id":"51c619e0-0256-40ad-afba-ca4114b936f9","status":"released","short_reference":"20150504-SHKTFD","type":"bulk","conversion_ids":["9bb4a49b-f959-402f-8bb8-4463b18d93c7"],"entries":[{"USD":{"receive_amount":"0.00","send_amount":"1512.00"}},{"GBP":{"receive_amount":"1000.00","send_amount":"0.00"}}],"created_at":"2015-05-04T21:14:48+00:00","updated_at":"2015-05-04T21:44:23+00:00","released_at":"2015-05-04T21:44:23+00:00"}'
84
- http_version:
85
- recorded_at: Mon, 04 May 2015 21:50:54 GMT
86
- - request:
87
- method: post
88
- uri: https://devapi.currencycloud.com/v2/settlements/51c619e0-0256-40ad-afba-ca4114b936f9/unrelease
89
- body:
90
- encoding: US-ASCII
91
- string: ''
92
- headers:
93
- X-Auth-Token:
94
- - deadbeefdeadbeefdeadbeefdeadbeef
95
- response:
96
- status:
97
- code: 200
98
- message: OK
99
- headers:
100
- Server:
101
- - nginx
102
- Date:
103
- - Mon, 04 May 2015 21:51:51 GMT
104
- Content-Type:
105
- - application/json;charset=utf-8
106
- Content-Length:
107
- - '396'
108
- Connection:
109
- - keep-alive
110
- X-Request-Id:
111
- - '2778849575324579937'
112
- X-Content-Type-Options:
113
- - nosniff
114
- body:
115
- encoding: UTF-8
116
- string: '{"id":"51c619e0-0256-40ad-afba-ca4114b936f9","status":"open","short_reference":"20150504-SHKTFD","type":"bulk","conversion_ids":["9bb4a49b-f959-402f-8bb8-4463b18d93c7"],"entries":[{"USD":{"receive_amount":"0.00","send_amount":"1512.00"}},{"GBP":{"receive_amount":"1000.00","send_amount":"0.00"}}],"created_at":"2015-05-04T21:14:48+00:00","updated_at":"2015-05-04T21:51:51+00:00","released_at":""}'
117
- http_version:
118
- recorded_at: Mon, 04 May 2015 21:51:51 GMT
119
- recorded_with: VCR 3.0.3