currency_cloud 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +31 -0
  3. data/.rubocop.yml +6 -0
  4. data/.travis.yml +2 -4
  5. data/Gemfile +0 -3
  6. data/LICENSE.md +16 -17
  7. data/README.md +5 -3
  8. data/Rakefile +12 -12
  9. data/currency_cloud.gemspec +9 -9
  10. data/examples/server.rb +7 -7
  11. data/lib/currency_cloud/client.rb +5 -1
  12. data/lib/currency_cloud/conversion.rb +15 -0
  13. data/lib/currency_cloud/conversion_cancel_result.rb +5 -0
  14. data/lib/currency_cloud/conversion_date_change_result.rb +5 -0
  15. data/lib/currency_cloud/conversion_split_result.rb +5 -0
  16. data/lib/currency_cloud/errors/api_error.rb +2 -2
  17. data/lib/currency_cloud/errors/error_utils.rb +4 -4
  18. data/lib/currency_cloud/errors/unexpected_error.rb +3 -3
  19. data/lib/currency_cloud/iban.rb +22 -0
  20. data/lib/currency_cloud/ibans.rb +6 -0
  21. data/lib/currency_cloud/payer_required_details.rb +5 -0
  22. data/lib/currency_cloud/payment.rb +10 -0
  23. data/lib/currency_cloud/payment_authorisation_result.rb +5 -0
  24. data/lib/currency_cloud/payment_dates.rb +5 -0
  25. data/lib/currency_cloud/payment_submission.rb +5 -0
  26. data/lib/currency_cloud/purpose_code.rb +5 -0
  27. data/lib/currency_cloud/reference.rb +20 -5
  28. data/lib/currency_cloud/request_handler.rb +1 -3
  29. data/lib/currency_cloud/response_handler.rb +7 -7
  30. data/lib/currency_cloud/session.rb +2 -3
  31. data/lib/currency_cloud/transfer.rb +8 -0
  32. data/lib/currency_cloud/version.rb +1 -1
  33. data/lib/currency_cloud/virtual_account.rb +22 -0
  34. data/lib/currency_cloud/virtual_accounts.rb +6 -0
  35. data/spec/currency_cloud_spec.rb +9 -9
  36. data/spec/integration/authentication_spec.rb +2 -2
  37. data/spec/integration/conversions_spec.rb +94 -0
  38. data/spec/integration/error_utils_spec.rb +12 -12
  39. data/spec/integration/errors_spec.rb +84 -102
  40. data/spec/integration/ibans_spec.rb +42 -0
  41. data/spec/integration/payment_spec.rb +31 -0
  42. data/spec/integration/payments_spec.rb +67 -0
  43. data/spec/integration/reference_spec.rb +37 -14
  44. data/spec/integration/transfers_spec.rb +39 -0
  45. data/spec/integration/virtual_accounts_spec.rb +37 -0
  46. data/spec/spec_helper.rb +9 -1
  47. data/spec/support/vcr_cassettes/Authentication/can_be_closed.yml +1 -1
  48. data/spec/support/vcr_cassettes/Authentication/handles_session_timeout_error.yml +1 -1
  49. data/spec/support/vcr_cassettes/Authentication/happens_lazily.yml +1 -1
  50. data/spec/support/vcr_cassettes/Conversions/can_cancel_conversion/with_notes/has_a_non-empty_notes_attribute.yml +158 -0
  51. data/spec/support/vcr_cassettes/Conversions/can_cancel_conversion/without_notes/has_a_empty_notes_attribute.yml +157 -0
  52. data/spec/support/vcr_cassettes/Conversions/can_date_change_conversion.yml +157 -0
  53. data/spec/support/vcr_cassettes/Conversions/can_split_conversion.yml +157 -0
  54. data/spec/support/vcr_cassettes/Error/contains_full_details_for_api_error.yml +1 -1
  55. data/spec/support/vcr_cassettes/Error/is_raised_on_a_bad_request.yml +1 -1
  56. data/spec/support/vcr_cassettes/Error/is_raised_on_a_forbidden_request.yml +1 -1
  57. data/spec/support/vcr_cassettes/Error/is_raised_on_an_internal_server_error.yml +1 -1
  58. data/spec/support/vcr_cassettes/Error/is_raised_on_incorrect_authentication_details.yml +1 -1
  59. data/spec/support/vcr_cassettes/Error/is_raised_when_too_many_requests_have_been_issued.yml +1 -1
  60. data/spec/support/vcr_cassettes/IBANs/can_IBANs_for_a_specific_subaccount.yml +109 -0
  61. data/spec/support/vcr_cassettes/IBANs/can_IBANs_for_subaccounts.yml +108 -0
  62. data/spec/support/vcr_cassettes/IBANs/can_find.yml +114 -0
  63. data/spec/support/vcr_cassettes/Payments/can_authorise/when_payment_ids_are_valid.yml +263 -0
  64. data/spec/support/vcr_cassettes/Payments/can_create.yml +155 -0
  65. data/spec/support/vcr_cassettes/Payments/can_get_the_submission.yml +205 -0
  66. data/spec/support/vcr_cassettes/Reference/can_retrieve_beneficiary_required_details.yml +77 -12
  67. data/spec/support/vcr_cassettes/Reference/can_retrieve_conversion_dates.yml +183 -22
  68. data/spec/support/vcr_cassettes/Reference/can_retrieve_currencies.yml +110 -22
  69. data/spec/support/vcr_cassettes/Reference/can_retrieve_payer_required_details.yml +103 -0
  70. data/spec/support/vcr_cassettes/Reference/can_retrieve_payment_dates.yml +110 -0
  71. data/spec/support/vcr_cassettes/Reference/can_retrieve_payment_purpose_codes.yml +128 -0
  72. data/spec/support/vcr_cassettes/Reference/can_retrieve_settlement_accounts.yml +76 -11
  73. data/spec/support/vcr_cassettes/Settlements/can_add_conversion.yml +56 -6
  74. data/spec/support/vcr_cassettes/Settlements/can_release.yml +55 -5
  75. data/spec/support/vcr_cassettes/Settlements/can_remove_conversion.yml +55 -5
  76. data/spec/support/vcr_cassettes/Settlements/can_unrelease.yml +55 -5
  77. data/spec/support/vcr_cassettes/Transfers/can_create.yml +101 -0
  78. data/spec/support/vcr_cassettes/Transfers/can_find.yml +151 -0
  79. data/spec/support/vcr_cassettes/Transfers/can_retrieve.yml +151 -0
  80. data/spec/support/vcr_cassettes/VirtualAccounts/can_find.yml +108 -0
  81. data/spec/support/vcr_cassettes/VirtualAccounts/can_find_VANs_for_a_specific_subaccount.yml +108 -0
  82. data/spec/support/vcr_cassettes/VirtualAccounts/can_find_VANs_for_subaccounts.yml +108 -0
  83. metadata +82 -20
  84. data/Guardfile +0 -14
@@ -0,0 +1,157 @@
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.9.0
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ Date:
18
+ - Mon, 16 Jul 2018 10:41:09 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=ZEHOmsiI8OM+PMmgRYsQplgAjl9nKpR2eDUds0hG7pDuB8O8Lck3GPZjIYcGlTkcUhty7JfDrqw9v202bUnMB4t5U2t8VoqrqxfYVWOqvLNiRu7yRGTq2iGY7Ysh;
27
+ Expires=Mon, 23 Jul 2018 10:41:07 GMT; Path=/
28
+ - __cfduid=d612e562e2c8be10df9bbb486f008cf481531737667; expires=Tue, 16-Jul-19
29
+ 10:41:07 GMT; path=/; domain=.currencycloud.com; HttpOnly
30
+ Access-Control-Allow-Origin:
31
+ - "*"
32
+ X-Request-Id:
33
+ - 144bd2ed-bcbf-4c81-8fbb-b35fc648e03c
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
+ - 43b3dac5ea5e06d0-LHR
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"auth_token":"deadbeefdeadbeefdeadbeefdeadbeef"}'
51
+ http_version:
52
+ recorded_at: Mon, 16 Jul 2018 10:41:09 GMT
53
+ - request:
54
+ method: post
55
+ uri: https://devapi.currencycloud.com/v2/conversions/create
56
+ body:
57
+ encoding: UTF-8
58
+ string: buy_currency=USD&sell_currency=GBP&fixed_side=buy&amount=95000&reason=SDK%20conversion%20testing&term_agreement=true
59
+ headers:
60
+ X-Auth-Token:
61
+ - deadbeefdeadbeefdeadbeefdeadbeef
62
+ User-Agent:
63
+ - CurrencyCloudSDK/2.0 Ruby/0.9.0
64
+ response:
65
+ status:
66
+ code: 200
67
+ message: OK
68
+ headers:
69
+ Date:
70
+ - Mon, 16 Jul 2018 10:41:09 GMT
71
+ Content-Type:
72
+ - application/json;charset=utf-8
73
+ Transfer-Encoding:
74
+ - chunked
75
+ Connection:
76
+ - keep-alive
77
+ Set-Cookie:
78
+ - AWSALB=OtpPXkCMvsWONFO9PstNhQZ6b3YGaAV1V3PCwrwePv4SdC9e4D1R0LG9x3OHKhCcT85gQqlfTBO1VGTt0GouQEwiYnznDrBuk+DoHOTrYjTs9rwTtPyzKzZOKayv;
79
+ Expires=Mon, 23 Jul 2018 10:41:09 GMT; Path=/
80
+ - __cfduid=dd22aff118b982fc2d61920a17c0cef4a1531737669; expires=Tue, 16-Jul-19
81
+ 10:41:09 GMT; path=/; domain=.currencycloud.com; HttpOnly
82
+ Access-Control-Allow-Origin:
83
+ - "*"
84
+ X-Request-Id:
85
+ - 9c175aba-2875-4e5c-b1a7-ce946e02ef04
86
+ Access-Control-Allow-Methods:
87
+ - POST
88
+ X-Content-Type-Options:
89
+ - nosniff
90
+ Vary:
91
+ - Origin
92
+ Access-Control-Allow-Headers:
93
+ - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
94
+ Expect-Ct:
95
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
96
+ Server:
97
+ - cloudflare
98
+ Cf-Ray:
99
+ - 43b3dad01b820a66-LHR
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"id":"70e15a24-9a4c-4c56-8f68-3816965eb311","settlement_date":"2018-07-18T15:30:00+00:00","conversion_date":"2018-07-18T00:00:00+00:00","short_reference":"20180716-YTCSSY","creator_contact_id":"04d0c252-7b78-4d72-b408-df78841e3ddc","account_id":"67e1b252-40a7-454d-a097-8f77d385889d","currency_pair":"GBPUSD","status":"awaiting_funds","buy_currency":"USD","sell_currency":"GBP","client_buy_amount":"95000.00","client_sell_amount":"67476.38","fixed_side":"buy","core_rate":"1.4079","partner_rate":"","partner_status":"awaiting_funds","partner_buy_amount":"0.00","partner_sell_amount":"0.00","client_rate":"1.4079","deposit_required":false,"deposit_amount":"0.00","deposit_currency":"","deposit_status":"not_required","deposit_required_at":"","payment_ids":[],"unallocated_funds":"0.00","unique_request_id":null,"created_at":"2018-07-16T10:41:09+00:00","updated_at":"2018-07-16T10:41:09+00:00","mid_market_rate":"1.4080"}'
103
+ http_version:
104
+ recorded_at: Mon, 16 Jul 2018 10:41:09 GMT
105
+ - request:
106
+ method: post
107
+ uri: https://devapi.currencycloud.com/v2/conversions/70e15a24-9a4c-4c56-8f68-3816965eb311/cancel
108
+ body:
109
+ encoding: US-ASCII
110
+ string: ''
111
+ headers:
112
+ X-Auth-Token:
113
+ - deadbeefdeadbeefdeadbeefdeadbeef
114
+ User-Agent:
115
+ - CurrencyCloudSDK/2.0 Ruby/0.9.0
116
+ response:
117
+ status:
118
+ code: 200
119
+ message: OK
120
+ headers:
121
+ Date:
122
+ - Mon, 16 Jul 2018 10:41:10 GMT
123
+ Content-Type:
124
+ - application/json;charset=utf-8
125
+ Transfer-Encoding:
126
+ - chunked
127
+ Connection:
128
+ - keep-alive
129
+ Set-Cookie:
130
+ - AWSALB=84q2RtK7oG9Fr2vGEOaGeilkJXRmhiSGem57M5DB05NAFq9ovlaxXJA3W7oVRUhwferO5ghHcqnCkEi5a9fA7xENlgcCPcCcv4c1Mjki6k2xb/cKwCEmcgH2rdB7;
131
+ Expires=Mon, 23 Jul 2018 10:41:10 GMT; Path=/
132
+ - __cfduid=dc27dafb2dadeff88f63749a2f1c226381531737669; expires=Tue, 16-Jul-19
133
+ 10:41:09 GMT; path=/; domain=.currencycloud.com; HttpOnly
134
+ Access-Control-Allow-Origin:
135
+ - "*"
136
+ X-Request-Id:
137
+ - 012ea49f-f220-45af-bdbb-d7bce9456062
138
+ Access-Control-Allow-Methods:
139
+ - POST
140
+ X-Content-Type-Options:
141
+ - nosniff
142
+ Vary:
143
+ - Origin
144
+ Access-Control-Allow-Headers:
145
+ - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
146
+ Expect-Ct:
147
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
148
+ Server:
149
+ - cloudflare
150
+ Cf-Ray:
151
+ - 43b3dad55dcc1377-LHR
152
+ body:
153
+ encoding: UTF-8
154
+ string: '{"account_id":"67e1b252-40a7-454d-a097-8f77d385889d","contact_id":"04d0c252-7b78-4d72-b408-df78841e3ddc","event_account_id":"67e1b252-40a7-454d-a097-8f77d385889d","event_contact_id":"04d0c252-7b78-4d72-b408-df78841e3ddc","conversion_id":"70e15a24-9a4c-4c56-8f68-3816965eb311","event_type":"self_service_cancellation","amount":"-9.58","currency":"GBP","notes":"","event_date_time":"2018-07-16T10:41:10+00:00"}'
155
+ http_version:
156
+ recorded_at: Mon, 16 Jul 2018 10:41:10 GMT
157
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,157 @@
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.9.0
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ Date:
18
+ - Mon, 16 Jul 2018 10:41:01 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=vXPMrQHpw9Wnjy7+bmSmGNNZ0/LlqT8mF2e21JzFygFQO4iIzZlOdClYeZ9IA/s+b7zZ6N+VsW49FrRTU4gkfP3xbb+iJ2kXHT6x5EsGi9XbJS/lmW0kL8GrqyFF;
27
+ Expires=Mon, 23 Jul 2018 10:41:00 GMT; Path=/
28
+ - __cfduid=debc59aabd0047b5912c373deb5bcfe3c1531737659; expires=Tue, 16-Jul-19
29
+ 10:40:59 GMT; path=/; domain=.currencycloud.com; HttpOnly
30
+ Access-Control-Allow-Origin:
31
+ - "*"
32
+ X-Request-Id:
33
+ - bc65f138-1553-4335-a323-1324f365b3b2
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
+ - 43b3da939b2206d0-LHR
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"auth_token":"deadbeefdeadbeefdeadbeefdeadbeef"}'
51
+ http_version:
52
+ recorded_at: Mon, 16 Jul 2018 10:41:02 GMT
53
+ - request:
54
+ method: post
55
+ uri: https://devapi.currencycloud.com/v2/conversions/create
56
+ body:
57
+ encoding: UTF-8
58
+ string: buy_currency=USD&sell_currency=GBP&fixed_side=buy&amount=95000&reason=SDK%20conversion%20testing&term_agreement=true
59
+ headers:
60
+ X-Auth-Token:
61
+ - deadbeefdeadbeefdeadbeefdeadbeef
62
+ User-Agent:
63
+ - CurrencyCloudSDK/2.0 Ruby/0.9.0
64
+ response:
65
+ status:
66
+ code: 200
67
+ message: OK
68
+ headers:
69
+ Date:
70
+ - Mon, 16 Jul 2018 10:41:03 GMT
71
+ Content-Type:
72
+ - application/json;charset=utf-8
73
+ Transfer-Encoding:
74
+ - chunked
75
+ Connection:
76
+ - keep-alive
77
+ Set-Cookie:
78
+ - AWSALB=9OdLaIhbko8Tr0PYqPvsLwvQLdE9f8JF/+dR1+NnHUXuxsB7t+9i06PQD7HegBKUNPRfukmamzapvXNSEhz4dE4SrXTsEaWKMflbF9W5KA+tSdTKT9if/pNjPxCu;
79
+ Expires=Mon, 23 Jul 2018 10:41:02 GMT; Path=/
80
+ - __cfduid=d137cc72d73a1e518744bfe12f26854491531737662; expires=Tue, 16-Jul-19
81
+ 10:41:02 GMT; path=/; domain=.currencycloud.com; HttpOnly
82
+ Access-Control-Allow-Origin:
83
+ - "*"
84
+ X-Request-Id:
85
+ - d6ac4c01-63c2-4154-9f2d-6097a11ffefb
86
+ Access-Control-Allow-Methods:
87
+ - POST
88
+ X-Content-Type-Options:
89
+ - nosniff
90
+ Vary:
91
+ - Origin
92
+ Access-Control-Allow-Headers:
93
+ - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
94
+ Expect-Ct:
95
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
96
+ Server:
97
+ - cloudflare
98
+ Cf-Ray:
99
+ - 43b3daa3ec5d0a72-LHR
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"id":"f2106374-2084-4827-ad6c-68c47720379e","settlement_date":"2018-07-18T15:30:00+00:00","conversion_date":"2018-07-18T00:00:00+00:00","short_reference":"20180716-LNLSYQ","creator_contact_id":"04d0c252-7b78-4d72-b408-df78841e3ddc","account_id":"67e1b252-40a7-454d-a097-8f77d385889d","currency_pair":"GBPUSD","status":"awaiting_funds","buy_currency":"USD","sell_currency":"GBP","client_buy_amount":"95000.00","client_sell_amount":"67476.38","fixed_side":"buy","core_rate":"1.4079","partner_rate":"","partner_status":"awaiting_funds","partner_buy_amount":"0.00","partner_sell_amount":"0.00","client_rate":"1.4079","deposit_required":false,"deposit_amount":"0.00","deposit_currency":"","deposit_status":"not_required","deposit_required_at":"","payment_ids":[],"unallocated_funds":"0.00","unique_request_id":null,"created_at":"2018-07-16T10:41:02+00:00","updated_at":"2018-07-16T10:41:02+00:00","mid_market_rate":"1.4080"}'
103
+ http_version:
104
+ recorded_at: Mon, 16 Jul 2018 10:41:03 GMT
105
+ - request:
106
+ method: post
107
+ uri: https://devapi.currencycloud.com/v2/conversions/f2106374-2084-4827-ad6c-68c47720379e/date_change
108
+ body:
109
+ encoding: UTF-8
110
+ string: new_settlement_date=2018-07-17%2011%3A40%3A59%20%2B0100
111
+ headers:
112
+ X-Auth-Token:
113
+ - deadbeefdeadbeefdeadbeefdeadbeef
114
+ User-Agent:
115
+ - CurrencyCloudSDK/2.0 Ruby/0.9.0
116
+ response:
117
+ status:
118
+ code: 200
119
+ message: OK
120
+ headers:
121
+ Date:
122
+ - Mon, 16 Jul 2018 10:41:04 GMT
123
+ Content-Type:
124
+ - application/json;charset=utf-8
125
+ Transfer-Encoding:
126
+ - chunked
127
+ Connection:
128
+ - keep-alive
129
+ Set-Cookie:
130
+ - AWSALB=3sl4GXqUtpmWb2PxJLFOGV4oYCdmgYxe1L/IpqzV5ljIEqOZFNVI+1/tj4c5cJWIm+vXhutYXzbLzXn2f9seJZKgWFJAtz2YxIYcw4fgk2Aog+msuX+9GxrwOqon;
131
+ Expires=Mon, 23 Jul 2018 10:41:03 GMT; Path=/
132
+ - __cfduid=d782665fde992c11651d7de322800e1cc1531737663; expires=Tue, 16-Jul-19
133
+ 10:41:03 GMT; path=/; domain=.currencycloud.com; HttpOnly
134
+ Access-Control-Allow-Origin:
135
+ - "*"
136
+ X-Request-Id:
137
+ - 1a23b179-1dc2-4e65-9523-94bb8a095ba2
138
+ Access-Control-Allow-Methods:
139
+ - POST
140
+ X-Content-Type-Options:
141
+ - nosniff
142
+ Vary:
143
+ - Origin
144
+ Access-Control-Allow-Headers:
145
+ - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
146
+ Expect-Ct:
147
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
148
+ Server:
149
+ - cloudflare
150
+ Cf-Ray:
151
+ - 43b3daab0d2a0a8a-LHR
152
+ body:
153
+ encoding: UTF-8
154
+ string: '{"conversion_id":"f2106374-2084-4827-ad6c-68c47720379e","amount":"-14.38","currency":"GBP","new_conversion_date":"2018-07-17T00:00:00+00:00","new_settlement_date":"2018-07-17T15:30:00+00:00","old_conversion_date":"2018-07-18T00:00:00+00:00","old_settlement_date":"2018-07-18T15:30:00+00:00","event_date_time":"2018-07-16T10:41:03+00:00"}'
155
+ http_version:
156
+ recorded_at: Mon, 16 Jul 2018 10:41:04 GMT
157
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,157 @@
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.9.0
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ Date:
18
+ - Mon, 16 Jul 2018 10:41:05 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=6PC1HmZrhiw12mGtDeNAe6MKMxwkrh6lMdcIO6O/fJrHgV5/hYjkSE478DnzR2XFgxRU5U5b3EyblXtDLaSc4iYGSciicl4k9En+TFqTabJH+7BuSdeoNkeuHxAh;
27
+ Expires=Mon, 23 Jul 2018 10:41:04 GMT; Path=/
28
+ - __cfduid=d2428f818dd606d71ef49c356f6a624b31531737664; expires=Tue, 16-Jul-19
29
+ 10:41:04 GMT; path=/; domain=.currencycloud.com; HttpOnly
30
+ Access-Control-Allow-Origin:
31
+ - "*"
32
+ X-Request-Id:
33
+ - 2c1f89c4-7394-4b57-93ef-efdd79befbef
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
+ - 43b3dab0883a0a84-LHR
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"auth_token":"deadbeefdeadbeefdeadbeefdeadbeef"}'
51
+ http_version:
52
+ recorded_at: Mon, 16 Jul 2018 10:41:05 GMT
53
+ - request:
54
+ method: post
55
+ uri: https://devapi.currencycloud.com/v2/conversions/create
56
+ body:
57
+ encoding: UTF-8
58
+ string: buy_currency=USD&sell_currency=GBP&fixed_side=buy&amount=95000&reason=SDK%20conversion%20testing&term_agreement=true
59
+ headers:
60
+ X-Auth-Token:
61
+ - deadbeefdeadbeefdeadbeefdeadbeef
62
+ User-Agent:
63
+ - CurrencyCloudSDK/2.0 Ruby/0.9.0
64
+ response:
65
+ status:
66
+ code: 200
67
+ message: OK
68
+ headers:
69
+ Date:
70
+ - Mon, 16 Jul 2018 10:41:06 GMT
71
+ Content-Type:
72
+ - application/json;charset=utf-8
73
+ Transfer-Encoding:
74
+ - chunked
75
+ Connection:
76
+ - keep-alive
77
+ Set-Cookie:
78
+ - AWSALB=L3g6+O+jRcfOxoLTYV/ET4TK5xsBI+T2LGFbTc+2LUXDSHk+pFWWXREzy5pcM+fFBzxfEj9/tf0lL8dyMfy2uXuveLWvPuAZb6T9rEy41EIzRRvJKKY/nAQd9bMM;
79
+ Expires=Mon, 23 Jul 2018 10:41:05 GMT; Path=/
80
+ - __cfduid=df250c693a60f31295b2bb1dab1bac6981531737665; expires=Tue, 16-Jul-19
81
+ 10:41:05 GMT; path=/; domain=.currencycloud.com; HttpOnly
82
+ Access-Control-Allow-Origin:
83
+ - "*"
84
+ X-Request-Id:
85
+ - 42c1e621-9604-4915-bf00-480aeb2dd62e
86
+ Access-Control-Allow-Methods:
87
+ - POST
88
+ X-Content-Type-Options:
89
+ - nosniff
90
+ Vary:
91
+ - Origin
92
+ Access-Control-Allow-Headers:
93
+ - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
94
+ Expect-Ct:
95
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
96
+ Server:
97
+ - cloudflare
98
+ Cf-Ray:
99
+ - 43b3dabb0b1e06c4-LHR
100
+ body:
101
+ encoding: UTF-8
102
+ string: '{"id":"c956f45b-52a5-4aee-a532-7c1c20f6f934","settlement_date":"2018-07-18T15:30:00+00:00","conversion_date":"2018-07-18T00:00:00+00:00","short_reference":"20180716-WRJWLF","creator_contact_id":"04d0c252-7b78-4d72-b408-df78841e3ddc","account_id":"67e1b252-40a7-454d-a097-8f77d385889d","currency_pair":"GBPUSD","status":"awaiting_funds","buy_currency":"USD","sell_currency":"GBP","client_buy_amount":"95000.00","client_sell_amount":"67476.38","fixed_side":"buy","core_rate":"1.4079","partner_rate":"","partner_status":"awaiting_funds","partner_buy_amount":"0.00","partner_sell_amount":"0.00","client_rate":"1.4079","deposit_required":false,"deposit_amount":"0.00","deposit_currency":"","deposit_status":"not_required","deposit_required_at":"","payment_ids":[],"unallocated_funds":"0.00","unique_request_id":null,"created_at":"2018-07-16T10:41:06+00:00","updated_at":"2018-07-16T10:41:06+00:00","mid_market_rate":"1.4080"}'
103
+ http_version:
104
+ recorded_at: Mon, 16 Jul 2018 10:41:06 GMT
105
+ - request:
106
+ method: post
107
+ uri: https://devapi.currencycloud.com/v2/conversions/c956f45b-52a5-4aee-a532-7c1c20f6f934/split
108
+ body:
109
+ encoding: UTF-8
110
+ string: amount=45000
111
+ headers:
112
+ X-Auth-Token:
113
+ - deadbeefdeadbeefdeadbeefdeadbeef
114
+ User-Agent:
115
+ - CurrencyCloudSDK/2.0 Ruby/0.9.0
116
+ response:
117
+ status:
118
+ code: 200
119
+ message: OK
120
+ headers:
121
+ Date:
122
+ - Mon, 16 Jul 2018 10:41:07 GMT
123
+ Content-Type:
124
+ - application/json;charset=utf-8
125
+ Transfer-Encoding:
126
+ - chunked
127
+ Connection:
128
+ - keep-alive
129
+ Set-Cookie:
130
+ - AWSALB=zisVxKawvZFChQFxmVmy91snfts7wNliVxCc+HbRM3zwk5bRnkUaVAXSMa5t2Lg8e2nEawPtSmhgiQmZ/5zwCrL19rbjs9zFTenv9MaiKfzZfHvkq08bv2l4e+Xj;
131
+ Expires=Mon, 23 Jul 2018 10:41:06 GMT; Path=/
132
+ - __cfduid=da591275395a19f214e9312dbc078973c1531737666; expires=Tue, 16-Jul-19
133
+ 10:41:06 GMT; path=/; domain=.currencycloud.com; HttpOnly
134
+ Access-Control-Allow-Origin:
135
+ - "*"
136
+ X-Request-Id:
137
+ - 18946bc1-0f66-4c8a-a9b5-8a05acc66b44
138
+ Access-Control-Allow-Methods:
139
+ - POST
140
+ X-Content-Type-Options:
141
+ - nosniff
142
+ Vary:
143
+ - Origin
144
+ Access-Control-Allow-Headers:
145
+ - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction,X-Auth-Token,Origin,Authority
146
+ Expect-Ct:
147
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
148
+ Server:
149
+ - cloudflare
150
+ Cf-Ray:
151
+ - 43b3dabf7988bc50-LHR
152
+ body:
153
+ encoding: UTF-8
154
+ string: '{"parent_conversion":{"id":"c956f45b-52a5-4aee-a532-7c1c20f6f934","short_reference":"20180716-WRJWLF","sell_amount":"35513.88","sell_currency":"GBP","buy_amount":"50000.00","buy_currency":"USD","settlement_date":"2018-07-18T15:30:00+00:00","conversion_date":"2018-07-18T00:00:00+00:00","status":"awaiting_funds"},"child_conversion":{"id":"7e943da9-fb4d-4da2-89f8-3543054b6aa1","short_reference":"20180716-GDGNRV","sell_amount":"31962.50","sell_currency":"GBP","buy_amount":"45000.00","buy_currency":"USD","settlement_date":"2018-07-18T15:30:00+00:00","conversion_date":"2018-07-18T00:00:00+00:00","status":"awaiting_funds"}}'
155
+ http_version:
156
+ recorded_at: Mon, 16 Jul 2018 10:41:07 GMT
157
+ recorded_with: VCR 3.0.3