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.
- checksums.yaml +4 -4
- data/.gitignore +31 -0
- data/.rubocop.yml +6 -0
- data/.travis.yml +2 -4
- data/Gemfile +0 -3
- data/LICENSE.md +16 -17
- data/README.md +5 -3
- data/Rakefile +12 -12
- data/currency_cloud.gemspec +9 -9
- data/examples/server.rb +7 -7
- data/lib/currency_cloud/client.rb +5 -1
- data/lib/currency_cloud/conversion.rb +15 -0
- data/lib/currency_cloud/conversion_cancel_result.rb +5 -0
- data/lib/currency_cloud/conversion_date_change_result.rb +5 -0
- data/lib/currency_cloud/conversion_split_result.rb +5 -0
- data/lib/currency_cloud/errors/api_error.rb +2 -2
- data/lib/currency_cloud/errors/error_utils.rb +4 -4
- data/lib/currency_cloud/errors/unexpected_error.rb +3 -3
- data/lib/currency_cloud/iban.rb +22 -0
- data/lib/currency_cloud/ibans.rb +6 -0
- data/lib/currency_cloud/payer_required_details.rb +5 -0
- data/lib/currency_cloud/payment.rb +10 -0
- data/lib/currency_cloud/payment_authorisation_result.rb +5 -0
- data/lib/currency_cloud/payment_dates.rb +5 -0
- data/lib/currency_cloud/payment_submission.rb +5 -0
- data/lib/currency_cloud/purpose_code.rb +5 -0
- data/lib/currency_cloud/reference.rb +20 -5
- data/lib/currency_cloud/request_handler.rb +1 -3
- data/lib/currency_cloud/response_handler.rb +7 -7
- data/lib/currency_cloud/session.rb +2 -3
- data/lib/currency_cloud/transfer.rb +8 -0
- data/lib/currency_cloud/version.rb +1 -1
- data/lib/currency_cloud/virtual_account.rb +22 -0
- data/lib/currency_cloud/virtual_accounts.rb +6 -0
- data/spec/currency_cloud_spec.rb +9 -9
- data/spec/integration/authentication_spec.rb +2 -2
- data/spec/integration/conversions_spec.rb +94 -0
- data/spec/integration/error_utils_spec.rb +12 -12
- data/spec/integration/errors_spec.rb +84 -102
- data/spec/integration/ibans_spec.rb +42 -0
- data/spec/integration/payment_spec.rb +31 -0
- data/spec/integration/payments_spec.rb +67 -0
- data/spec/integration/reference_spec.rb +37 -14
- data/spec/integration/transfers_spec.rb +39 -0
- data/spec/integration/virtual_accounts_spec.rb +37 -0
- data/spec/spec_helper.rb +9 -1
- data/spec/support/vcr_cassettes/Authentication/can_be_closed.yml +1 -1
- data/spec/support/vcr_cassettes/Authentication/handles_session_timeout_error.yml +1 -1
- data/spec/support/vcr_cassettes/Authentication/happens_lazily.yml +1 -1
- data/spec/support/vcr_cassettes/Conversions/can_cancel_conversion/with_notes/has_a_non-empty_notes_attribute.yml +158 -0
- data/spec/support/vcr_cassettes/Conversions/can_cancel_conversion/without_notes/has_a_empty_notes_attribute.yml +157 -0
- data/spec/support/vcr_cassettes/Conversions/can_date_change_conversion.yml +157 -0
- data/spec/support/vcr_cassettes/Conversions/can_split_conversion.yml +157 -0
- data/spec/support/vcr_cassettes/Error/contains_full_details_for_api_error.yml +1 -1
- data/spec/support/vcr_cassettes/Error/is_raised_on_a_bad_request.yml +1 -1
- data/spec/support/vcr_cassettes/Error/is_raised_on_a_forbidden_request.yml +1 -1
- data/spec/support/vcr_cassettes/Error/is_raised_on_an_internal_server_error.yml +1 -1
- data/spec/support/vcr_cassettes/Error/is_raised_on_incorrect_authentication_details.yml +1 -1
- data/spec/support/vcr_cassettes/Error/is_raised_when_too_many_requests_have_been_issued.yml +1 -1
- data/spec/support/vcr_cassettes/IBANs/can_IBANs_for_a_specific_subaccount.yml +109 -0
- data/spec/support/vcr_cassettes/IBANs/can_IBANs_for_subaccounts.yml +108 -0
- data/spec/support/vcr_cassettes/IBANs/can_find.yml +114 -0
- data/spec/support/vcr_cassettes/Payments/can_authorise/when_payment_ids_are_valid.yml +263 -0
- data/spec/support/vcr_cassettes/Payments/can_create.yml +155 -0
- data/spec/support/vcr_cassettes/Payments/can_get_the_submission.yml +205 -0
- data/spec/support/vcr_cassettes/Reference/can_retrieve_beneficiary_required_details.yml +77 -12
- data/spec/support/vcr_cassettes/Reference/can_retrieve_conversion_dates.yml +183 -22
- data/spec/support/vcr_cassettes/Reference/can_retrieve_currencies.yml +110 -22
- data/spec/support/vcr_cassettes/Reference/can_retrieve_payer_required_details.yml +103 -0
- data/spec/support/vcr_cassettes/Reference/can_retrieve_payment_dates.yml +110 -0
- data/spec/support/vcr_cassettes/Reference/can_retrieve_payment_purpose_codes.yml +128 -0
- data/spec/support/vcr_cassettes/Reference/can_retrieve_settlement_accounts.yml +76 -11
- data/spec/support/vcr_cassettes/Settlements/can_add_conversion.yml +56 -6
- data/spec/support/vcr_cassettes/Settlements/can_release.yml +55 -5
- data/spec/support/vcr_cassettes/Settlements/can_remove_conversion.yml +55 -5
- data/spec/support/vcr_cassettes/Settlements/can_unrelease.yml +55 -5
- data/spec/support/vcr_cassettes/Transfers/can_create.yml +101 -0
- data/spec/support/vcr_cassettes/Transfers/can_find.yml +151 -0
- data/spec/support/vcr_cassettes/Transfers/can_retrieve.yml +151 -0
- data/spec/support/vcr_cassettes/VirtualAccounts/can_find.yml +108 -0
- data/spec/support/vcr_cassettes/VirtualAccounts/can_find_VANs_for_a_specific_subaccount.yml +108 -0
- data/spec/support/vcr_cassettes/VirtualAccounts/can_find_VANs_for_subaccounts.yml +108 -0
- metadata +82 -20
- data/Guardfile +0 -14
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'IBANs', vcr: true do
|
4
|
+
it 'can #find' do
|
5
|
+
ibans = CurrencyCloud::IBAN.find
|
6
|
+
|
7
|
+
expect(ibans).to_not be_empty
|
8
|
+
expect(ibans).to be_a(CurrencyCloud::IBANs)
|
9
|
+
|
10
|
+
iban = ibans[0]
|
11
|
+
expect(iban).to be_a(CurrencyCloud::IBAN)
|
12
|
+
expect(iban.id).to eq "8242d1f4-4555-4155-a9bf-30feee785121"
|
13
|
+
expect(iban.iban_code).to eq 'GB51TCCL00997961584807'
|
14
|
+
expect(iban.currency).to eq 'EUR'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'can IBANs for subaccounts' do
|
18
|
+
ibans = CurrencyCloud::IBAN.for_subaccounts
|
19
|
+
|
20
|
+
expect(ibans).to_not be_empty
|
21
|
+
expect(ibans).to be_a(CurrencyCloud::IBANs)
|
22
|
+
|
23
|
+
iban = ibans[0]
|
24
|
+
expect(iban).to be_a(CurrencyCloud::IBAN)
|
25
|
+
expect(iban.id).to eq "01d8c0bc-7f0c-4cdd-bc7e-ef81f68500fe"
|
26
|
+
expect(iban.iban_code).to eq 'GB51TCCL00997997989489'
|
27
|
+
expect(iban.currency).to eq 'EUR'
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'can IBANs for a specific subaccount' do
|
31
|
+
ibans = CurrencyCloud::IBAN.for_subaccount('87077161-91de-012f-e284-1e0030c7f353')
|
32
|
+
|
33
|
+
expect(ibans).to_not be_empty
|
34
|
+
expect(ibans).to be_a(CurrencyCloud::IBANs)
|
35
|
+
|
36
|
+
iban = ibans[0]
|
37
|
+
expect(iban).to be_a(CurrencyCloud::IBAN)
|
38
|
+
expect(iban.id).to eq "01d8c0bc-7f0c-4cdd-bc7e-ef81f68500fe"
|
39
|
+
expect(iban.iban_code).to eq 'GB51TCCL00997997989490'
|
40
|
+
expect(iban.currency).to eq 'JPY'
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Payment', vcr: true do
|
4
|
+
let(:beneficiary_params) do
|
5
|
+
{
|
6
|
+
name: 'Employee Funds',
|
7
|
+
bank_account_holder_name: 'John Doe',
|
8
|
+
bank_country: 'GB',
|
9
|
+
currency: 'GBP',
|
10
|
+
email: 'john.doe@acme.com',
|
11
|
+
account_number: '1204567890003466',
|
12
|
+
routing_code_type_1: 'sort_code',
|
13
|
+
routing_code_value_1: '990901'
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
let(:beneficiary) do
|
18
|
+
CurrencyCloud::Beneficiary.create(beneficiary_params)
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:payment_params) do
|
22
|
+
{
|
23
|
+
currency: 'GBP',
|
24
|
+
beneficiary_id: beneficiary.id,
|
25
|
+
amount: 1_500,
|
26
|
+
reason: 'SDK payment testing',
|
27
|
+
reference: 'My reference code',
|
28
|
+
payment_type: 'regular'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Payments', vcr: true do
|
4
|
+
let(:beneficiary_details) do
|
5
|
+
{
|
6
|
+
bank_account_holder_name: 'Test User',
|
7
|
+
bank_country: 'GB',
|
8
|
+
currency: 'GBP',
|
9
|
+
name: 'Test User',
|
10
|
+
account_number: '12345678',
|
11
|
+
routing_code_type_1: 'sort_code',
|
12
|
+
routing_code_value_1: '123456'
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:beneficiary) { CurrencyCloud::Beneficiary.create(beneficiary_details) }
|
17
|
+
|
18
|
+
let(:payment_details) do
|
19
|
+
{
|
20
|
+
currency: 'GBP',
|
21
|
+
beneficiary_id: beneficiary.id,
|
22
|
+
amount: '1000',
|
23
|
+
reason: 'Testing payments',
|
24
|
+
reference: 'Testing payments',
|
25
|
+
payment_type: 'regular'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'can #create' do
|
30
|
+
payment = CurrencyCloud::Payment.create(payment_details)
|
31
|
+
expect(payment).to_not be_nil
|
32
|
+
expect(payment).to be_a(CurrencyCloud::Payment)
|
33
|
+
|
34
|
+
expect(payment.reason).to eq 'Testing payments'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'can get the submission' do
|
38
|
+
payment = CurrencyCloud::Payment.create(payment_details)
|
39
|
+
expect(payment).to_not be_nil
|
40
|
+
|
41
|
+
submission = payment.submission
|
42
|
+
expect(submission).to_not be_nil
|
43
|
+
expect(submission).to be_a(CurrencyCloud::PaymentSubmission)
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "can #authorise" do
|
47
|
+
before do
|
48
|
+
@payment = CurrencyCloud::Payment.create(payment_details)
|
49
|
+
|
50
|
+
CurrencyCloud.reset_session
|
51
|
+
CurrencyCloud.login_id = 'development+authorisations@currencycloud.com'
|
52
|
+
CurrencyCloud.api_key = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'when "payment_ids" are valid' do
|
56
|
+
authorisations = CurrencyCloud::Payment.authorise(@payment.id)
|
57
|
+
expect(authorisations).to_not be_empty
|
58
|
+
|
59
|
+
authorisation = authorisations.first
|
60
|
+
expect(authorisation).to be_a CurrencyCloud::PaymentAuthorisationResult
|
61
|
+
|
62
|
+
expect(authorisation.payment_id).to eq @payment.id
|
63
|
+
expect(authorisation.payment_status).to eq 'authorised'
|
64
|
+
expect(authorisation.updated).to eq true
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -2,9 +2,10 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Reference', vcr: true do
|
4
4
|
before do
|
5
|
-
CurrencyCloud.
|
5
|
+
CurrencyCloud.login_id = 'development@currencycloud.com'
|
6
|
+
CurrencyCloud.api_key = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
|
6
7
|
CurrencyCloud.environment = :demonstration
|
7
|
-
CurrencyCloud.
|
8
|
+
CurrencyCloud.reset_session
|
8
9
|
end
|
9
10
|
|
10
11
|
it 'can retrieve #beneficiary_required_details' do
|
@@ -12,14 +13,8 @@ describe 'Reference', vcr: true do
|
|
12
13
|
expect(details).to_not be_empty
|
13
14
|
|
14
15
|
details = details.first
|
15
|
-
expect(details['payment_type']).to eq('
|
16
|
-
expect(details['payment_type']).to eq('priority')
|
16
|
+
expect(details['payment_type']).to eq('regular')
|
17
17
|
expect(details['beneficiary_entity_type']).to eq('individual')
|
18
|
-
expect(details['beneficiary_address']).to eq('^.{1,255}')
|
19
|
-
expect(details['beneficiary_city']).to eq('^.{1,255}')
|
20
|
-
expect(details['beneficiary_country']).to eq('^[A-z]{2}$')
|
21
|
-
expect(details['beneficiary_first_name']).to eq('^.{1,255}')
|
22
|
-
expect(details['beneficiary_last_name']).to eq('^.{1,255}')
|
23
18
|
expect(details['acct_number']).to eq('^[0-9A-Z]{1,50}$')
|
24
19
|
expect(details['sort_code']).to eq('^\\d{6}$')
|
25
20
|
end
|
@@ -29,9 +24,9 @@ describe 'Reference', vcr: true do
|
|
29
24
|
|
30
25
|
expect(dates.invalid_conversion_dates).to_not be_empty
|
31
26
|
invalid_conversion_date = dates.invalid_conversion_dates.first
|
32
|
-
expect(invalid_conversion_date).to eq(['
|
33
|
-
expect(dates.first_conversion_date).to eq('
|
34
|
-
expect(dates.default_conversion_date).to eq('
|
27
|
+
expect(invalid_conversion_date).to eq(['2018-07-21', 'No trading on Saturday'])
|
28
|
+
expect(dates.first_conversion_date).to eq('2018-07-16')
|
29
|
+
expect(dates.default_conversion_date).to eq('2018-07-18')
|
35
30
|
end
|
36
31
|
|
37
32
|
it 'can retrieve #currencies' do
|
@@ -39,18 +34,46 @@ describe 'Reference', vcr: true do
|
|
39
34
|
expect(currencies).to_not be_empty
|
40
35
|
|
41
36
|
currency = currencies.first
|
42
|
-
expect(currency).to
|
37
|
+
expect(currency).to be_a(CurrencyCloud::Currency)
|
43
38
|
expect(currency.code).to eq('AED')
|
44
39
|
expect(currency.name).to eq('United Arab Emirates Dirham')
|
45
40
|
expect(currency.decimal_places).to eq(2)
|
46
41
|
end
|
47
42
|
|
43
|
+
it 'can retrieve #payer_required_details' do
|
44
|
+
payer_required_details = CurrencyCloud::Reference.payer_required_details(payer_country: 'GB')
|
45
|
+
expect(payer_required_details).to_not be_empty
|
46
|
+
|
47
|
+
required_details = payer_required_details[0]
|
48
|
+
expect(required_details).to be_a(CurrencyCloud::PayerRequiredDetails)
|
49
|
+
|
50
|
+
expect(required_details.payer_entity_type).to_not be_nil
|
51
|
+
expect(required_details.payment_type).to_not be_nil
|
52
|
+
expect(required_details.required_fields).to_not be_empty
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'can retrieve #payment_dates' do
|
56
|
+
payment_dates = CurrencyCloud::Reference.payment_dates(currency: 'GBP')
|
57
|
+
expect(payment_dates).to_not be_nil
|
58
|
+
expect(payment_dates).to be_a(CurrencyCloud::PaymentDates)
|
59
|
+
|
60
|
+
expect(payment_dates.invalid_payment_dates).to_not be_empty
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'can retrieve #payment_purpose_codes' do
|
64
|
+
payment_purpose_codes = CurrencyCloud::Reference.payment_purpose_codes(currency: 'INR')
|
65
|
+
expect(payment_purpose_codes).to_not be_empty
|
66
|
+
|
67
|
+
purpose_code = payment_purpose_codes.first
|
68
|
+
expect(purpose_code).to be_a(CurrencyCloud::PurposeCode)
|
69
|
+
end
|
70
|
+
|
48
71
|
it 'can retrieve #settlement_accounts' do
|
49
72
|
settlement_accounts = CurrencyCloud::Reference.settlement_accounts(currency: 'GBP')
|
50
73
|
expect(settlement_accounts).to_not be_empty
|
51
74
|
|
52
75
|
settlement_account = settlement_accounts.first
|
53
|
-
expect(settlement_account).to
|
76
|
+
expect(settlement_account).to be_a(CurrencyCloud::SettlementAccount)
|
54
77
|
expect(settlement_account.bank_account_holder_name).to eq('The Currency Cloud GBP - Client Seg A/C')
|
55
78
|
expect(settlement_account.bank_address).to be_empty
|
56
79
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Transfers', vcr: true do
|
4
|
+
let(:transfer_details) do
|
5
|
+
{
|
6
|
+
source_account_id: 'd0ad035e-b699-4fcd-a73c-13fb0910a884',
|
7
|
+
destination_account_id: 'e54a5e86-80ad-4434-90fe-0c8c751666de',
|
8
|
+
currency: 'GBP',
|
9
|
+
amount: '1000'
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'can #create' do
|
14
|
+
transfer = CurrencyCloud::Transfer.create(transfer_details)
|
15
|
+
expect(transfer).to_not be_nil
|
16
|
+
expect(transfer).to be_a(CurrencyCloud::Transfer)
|
17
|
+
|
18
|
+
expect(transfer.source_account_id).to eq 'd0ad035e-b699-4fcd-a73c-13fb0910a884'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'can #find' do
|
22
|
+
CurrencyCloud::Transfer.create(transfer_details)
|
23
|
+
|
24
|
+
transfers = CurrencyCloud::Transfer.find(currency: 'GBP', per_page: 1)
|
25
|
+
expect(transfers.length).to eq 1
|
26
|
+
|
27
|
+
transfer = transfers[0]
|
28
|
+
expect(transfer).to be_a(CurrencyCloud::Transfer)
|
29
|
+
expect(transfer.currency).to eq 'GBP'
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'can #retrieve' do
|
33
|
+
transfer_id = CurrencyCloud::Transfer.create(transfer_details).id
|
34
|
+
|
35
|
+
transfer = CurrencyCloud::Transfer.retrieve(transfer_id)
|
36
|
+
expect(transfer).to_not be_nil
|
37
|
+
expect(transfer).to be_a(CurrencyCloud::Transfer)
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'VirtualAccounts', vcr: true do
|
4
|
+
it 'can #find' do
|
5
|
+
vans = CurrencyCloud::VirtualAccount.find
|
6
|
+
|
7
|
+
expect(vans).to_not be_empty
|
8
|
+
expect(vans).to be_a(CurrencyCloud::VirtualAccounts)
|
9
|
+
|
10
|
+
van = vans[0]
|
11
|
+
expect(van).to be_a(CurrencyCloud::VirtualAccount)
|
12
|
+
expect(van.id).to eq "00d272ee-fae5-4f97-b425-993a2d6e3a46"
|
13
|
+
expect(van.virtual_account_number).to eq '8303723297'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'can find VANs for subaccounts' do
|
17
|
+
vans = CurrencyCloud::VirtualAccount.for_subaccounts
|
18
|
+
expect(vans).to_not be_empty
|
19
|
+
expect(vans).to be_a(CurrencyCloud::VirtualAccounts)
|
20
|
+
|
21
|
+
van = vans[0]
|
22
|
+
expect(van).to be_a(CurrencyCloud::VirtualAccount)
|
23
|
+
expect(van.id).to eq "00d272ee-fae5-4f97-b425-993a2d6e3a46"
|
24
|
+
expect(van.virtual_account_number).to eq '8303723297'
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'can find VANs for a specific subaccount' do
|
28
|
+
vans = CurrencyCloud::VirtualAccount.for_subaccount('87077161-91de-012f-e284-1e0030c7f353')
|
29
|
+
expect(vans).to_not be_empty
|
30
|
+
expect(vans).to be_a(CurrencyCloud::VirtualAccounts)
|
31
|
+
|
32
|
+
van = vans[0]
|
33
|
+
expect(van).to be_a(CurrencyCloud::VirtualAccount)
|
34
|
+
expect(van.id).to eq "00d272ee-fae5-4f97-b425-993a2d6e3a46"
|
35
|
+
expect(van.virtual_account_number).to eq '8303723297'
|
36
|
+
end
|
37
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'pry'
|
2
1
|
require 'vcr'
|
3
2
|
|
4
3
|
VCR.configure do |c|
|
@@ -10,3 +9,12 @@ VCR.configure do |c|
|
|
10
9
|
end
|
11
10
|
|
12
11
|
require 'currency_cloud'
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
config.before do
|
15
|
+
CurrencyCloud.login_id = 'development@currencycloud.com'
|
16
|
+
CurrencyCloud.api_key = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
|
17
|
+
CurrencyCloud.environment = :demonstration
|
18
|
+
CurrencyCloud.reset_session
|
19
|
+
end
|
20
|
+
end
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://devapi.currencycloud.com/v2/authenticate/api
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: login_id=
|
8
|
+
string: login_id=development%40currencycloud.com&api_key=deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
|
9
9
|
headers: {}
|
10
10
|
response:
|
11
11
|
status:
|
@@ -39,7 +39,7 @@ http_interactions:
|
|
39
39
|
uri: https://devapi.currencycloud.com/v2/authenticate/api
|
40
40
|
body:
|
41
41
|
encoding: UTF-8
|
42
|
-
string: login_id=
|
42
|
+
string: login_id=development%40currencycloud.com&api_key=deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
|
43
43
|
headers: {}
|
44
44
|
response:
|
45
45
|
status:
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://devapi.currencycloud.com/v2/authenticate/api
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: login_id=
|
8
|
+
string: login_id=development%40currencycloud.com&api_key=deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
|
9
9
|
headers: {}
|
10
10
|
response:
|
11
11
|
status:
|
@@ -0,0 +1,158 @@
|
|
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:12 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=yBgYKjcJj0u6FEX9Fby6XCzIHifH69/DE7iE/fsEeVfY21LA/TIbc9Mbn8Om/NuB27XHf0x6o0K9je9TOQMuUt0UsLKrz5j0nGVsrYSMwdiVmyRYCH0MzvRQVYhu;
|
27
|
+
Expires=Mon, 23 Jul 2018 10:41:10 GMT; Path=/
|
28
|
+
- __cfduid=d7c2d7b15fd072f2e6a3d82784fc0ebaa1531737670; expires=Tue, 16-Jul-19
|
29
|
+
10:41:10 GMT; path=/; domain=.currencycloud.com; HttpOnly
|
30
|
+
Access-Control-Allow-Origin:
|
31
|
+
- "*"
|
32
|
+
X-Request-Id:
|
33
|
+
- 61677c3a-8bf0-4c8f-b543-ef7367d62b07
|
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
|
+
- 43b3dadb0a54137d-LHR
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"auth_token":"deadbeefdeadbeefdeadbeefdeadbeef"}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Mon, 16 Jul 2018 10:41:12 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:13 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=kPEDIb5u7MNUkVOPPynbppWUqy6BdRV0PzTnzfLFkMxoi5dqdRjus9JageCyV83/+/RSMEgHAP3q3A0Qbx0d+1SryWUDMr+6ZEM7fVmgOCgHd5d2142J/h98fyoS;
|
79
|
+
Expires=Mon, 23 Jul 2018 10:41:12 GMT; Path=/
|
80
|
+
- __cfduid=df77720127ba8f4f9dbc7559fc3040a8c1531737672; expires=Tue, 16-Jul-19
|
81
|
+
10:41:12 GMT; path=/; domain=.currencycloud.com; HttpOnly
|
82
|
+
Access-Control-Allow-Origin:
|
83
|
+
- "*"
|
84
|
+
X-Request-Id:
|
85
|
+
- 5c423da2-fad0-49f7-8d90-9ed5bf4c5f8c
|
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
|
+
- 43b3dae5d9980a66-LHR
|
100
|
+
body:
|
101
|
+
encoding: UTF-8
|
102
|
+
string: '{"id":"81b23958-cde7-4882-a4ae-f0da6a95d6cb","settlement_date":"2018-07-18T15:30:00+00:00","conversion_date":"2018-07-18T00:00:00+00:00","short_reference":"20180716-MGHWYQ","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:12+00:00","updated_at":"2018-07-16T10:41:13+00:00","mid_market_rate":"1.4080"}'
|
103
|
+
http_version:
|
104
|
+
recorded_at: Mon, 16 Jul 2018 10:41:13 GMT
|
105
|
+
- request:
|
106
|
+
method: post
|
107
|
+
uri: https://devapi.currencycloud.com/v2/conversions/81b23958-cde7-4882-a4ae-f0da6a95d6cb/cancel
|
108
|
+
body:
|
109
|
+
encoding: UTF-8
|
110
|
+
string: notes=Business%20Terminated%20Contract
|
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:14 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=CPsdE2dKlqAr7Ce0uybmWUL+6azCONRdBosWGV6TfG3LgVTWHx1jiTVcqZdMXq9VDqGeogylymvK8vu0pXlj4t2eLgtwN/23PfeaVKWFt6FHFrqjxNwBfDt4dBOp;
|
131
|
+
Expires=Mon, 23 Jul 2018 10:41:13 GMT; Path=/
|
132
|
+
- __cfduid=daf5c616e86fed74225159aa259137d1e1531737673; expires=Tue, 16-Jul-19
|
133
|
+
10:41:13 GMT; path=/; domain=.currencycloud.com; HttpOnly
|
134
|
+
Access-Control-Allow-Origin:
|
135
|
+
- "*"
|
136
|
+
X-Request-Id:
|
137
|
+
- 036105c5-ad2e-4e89-8f36-306b1c187c60
|
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
|
+
- 43b3daeaf8080a6c-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":"81b23958-cde7-4882-a4ae-f0da6a95d6cb","event_type":"self_service_cancellation","amount":"-9.58","currency":"GBP","notes":"Business
|
155
|
+
Terminated Contract","event_date_time":"2018-07-16T10:41:14+00:00"}'
|
156
|
+
http_version:
|
157
|
+
recorded_at: Mon, 16 Jul 2018 10:41:14 GMT
|
158
|
+
recorded_with: VCR 3.0.3
|