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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21e40aa27737b56bbcb3fe6294f765bbb90c46ac
4
- data.tar.gz: 9cecc3d51f3109cca139f8f6d2402696810506b8
3
+ metadata.gz: ebec99730dd5705d4cf2c166f6df611617818e42
4
+ data.tar.gz: 397acffa929fd40cf630618f28540497bafd53e9
5
5
  SHA512:
6
- metadata.gz: 9062a94961ec83cf03efb75d3d344d2920d0422f8747c506266b53c8cc6b844793bc851e99a8a1c120be3623d9576651903be830afb9fc990a4f774521f2fc71
7
- data.tar.gz: 2382cd3f97358095d0ce9eae6e058772594a14f3159d812a600dc300982300d780cad847774e7bc6442ee3c46a7c7780af039805c822e1de6b51a4110a0852c5
6
+ metadata.gz: ff21d17e42f741459e92125e8551a6b93f5e9ee37d59af9dddd24182cbfbc185b9491fc6b39b9564ab94afcd1491ebc502e35ca2fa8019bcd88249a78b448394
7
+ data.tar.gz: 1e69916dc9465acbeadfead6d459c097b1281066ca984a2916d11678473e6a1a7390a2bb60c1e28ba5cceb8e19dd0726d82c70b79d69ddb952305ae0b824baf4
data/.gitignore CHANGED
@@ -1,3 +1,34 @@
1
1
  .DS_Store
2
+
2
3
  *.gem
4
+ *.rbc
5
+ /.config
6
+ /coverage/
7
+ /InstalledFiles
8
+ /pkg/
9
+ /spec/reports/
10
+ /spec/examples.txt
11
+ /test/tmp/
12
+ /test/version_tmp/
13
+ /tmp/
14
+
15
+ .env
16
+ .byebug_history
17
+
18
+ ## Documentation cache and generated files:
19
+ /.yardoc/
20
+ /_yardoc/
21
+ /doc/
22
+ /rdoc/
23
+
24
+ ## Environment normalization:
25
+ /.bundle/
26
+ /vendor/bundle
27
+ /lib/bundler/man/
28
+
3
29
  Gemfile.lock
30
+ .ruby-version
31
+ .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
@@ -6,3 +6,9 @@ Style/Documentation:
6
6
 
7
7
  Style/SymbolArray:
8
8
  EnforcedStyle: brackets
9
+
10
+ Style/NumericLiterals:
11
+ Enabled: false
12
+
13
+ Metrics/BlockLength:
14
+ Enabled: false
@@ -5,11 +5,9 @@ cache: bundler
5
5
 
6
6
  rvm:
7
7
  - 1.9.3
8
- - 2.0.0
9
- - 2.1
10
8
  - 2.2
11
9
  - 2.3.4
12
10
  - 2.4.1
13
11
  - jruby-19mode
14
- - jruby-9.1.5.0
15
- - rbx-3.74
12
+ - jruby-9.1.17.0
13
+ - jruby-9.2.0.0
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'guard-rspec', require: false
4
- gem 'guard', '2.12.6'
5
-
6
3
  gemspec
data/LICENSE.md CHANGED
@@ -1,22 +1,21 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015 Currency Cloud
3
+ Copyright (c) 2015-2018 Currencycloud
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
15
14
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE. OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  # Currencycloud
4
4
 
5
- This is the official Ruby SDK for v2 of Currencycloud's API. Additional documentation
6
- for each API endpoint can be found at [developer.currencycloud.com][developer]. If you have any queries or you require support, please contact our sales team at sales@currencycloud.com.
5
+ This is the official Ruby SDK for the Currencycloud API. Additional documentation for each API endpoint can be found at [developer.currencycloud.com][docs].
6
+
7
+ If you have any queries or you require support, please contact our development team at development@currencycloud.com Please quote your login id in any correspondence as this makes it easier for us to locate your account and give you the support you need.
7
8
 
8
9
  ## Installation
9
10
 
@@ -91,7 +92,7 @@ platform: Ruby 1.9.3
91
92
  request:
92
93
  parameters:
93
94
  login_id: non-existent-login-id
94
- api_key: ef0fd50fca1fb14c1fab3a8436b9ecb57528f0
95
+ api_key: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
95
96
  verb: post
96
97
  url: https://devapi.currencycloud.com/v2/authenticate/api
97
98
  response:
@@ -130,6 +131,7 @@ Test cases can be run with: `bundle exec rspec`. There is also a `Guardfile` tha
130
131
  is useful for continuously rerunning tests while you develop.
131
132
 
132
133
  ## Dependencies
134
+
133
135
  * [HTTParty][httparty]
134
136
  * [json][json]
135
137
 
data/Rakefile CHANGED
@@ -1,19 +1,19 @@
1
- desc "Run an IRB session"
1
+ desc 'Run an IRB session'
2
2
  task :console do
3
- exec "irb -I lib -r irb/completion -r currency_cloud"
3
+ exec 'irb -I lib -r irb/completion -r currency_cloud'
4
4
  end
5
5
 
6
6
  def play
7
7
  sleep 1
8
- puts "..."
8
+ puts '...'
9
9
  IRB.conf[:MAIN_CONTEXT].irb
10
- IRB.conf[:MAIN_CONTEXT].io.prompt = "HELLO"
10
+ IRB.conf[:MAIN_CONTEXT].io.prompt = 'HELLO'
11
11
  end
12
12
 
13
- desc "Run an IRB session in kiosk mode"
13
+ desc 'Run an IRB session in kiosk mode'
14
14
  task :kiosk do
15
- Thread.abort_on_exception=true
16
- #exec "irb -I lib -r irb/completion -r currency_cloud -r currency_cloud/kiosk"
15
+ Thread.abort_on_exception = true
16
+ # exec "irb -I lib -r irb/completion -r currency_cloud -r currency_cloud/kiosk"
17
17
  require 'irb'
18
18
  IRB.setup nil
19
19
  IRB.conf[:MAIN_CONTEXT] = IRB::Irb.new.context
@@ -22,9 +22,9 @@ task :kiosk do
22
22
  @irb = IRB.irb nil, self
23
23
  end
24
24
 
25
- desc "Test and build gem"
25
+ desc 'Test and build gem'
26
26
  task :build do
27
- sh("rm -f currency_cloud*.gem")
28
- sh("rspec")
29
- sh("gem build currency_cloud.gemspec")
30
- end
27
+ sh('rm -f currency_cloud*.gem')
28
+ sh('rspec')
29
+ sh('gem build currency_cloud.gemspec')
30
+ end
@@ -1,29 +1,29 @@
1
- $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
2
 
3
3
  require 'currency_cloud/version'
4
4
 
5
- spec = Gem::Specification.new do |s|
5
+ Gem::Specification.new do |s|
6
6
  s.name = 'currency_cloud'
7
7
  s.version = CurrencyCloud::VERSION
8
8
  s.summary = 'Ruby SDK for the Currency Cloud API'
9
- s.description = 'Ruby SDK for the Currency Cloud API - https://connect.currencycloud.com/'
9
+ s.description = 'Ruby SDK for the Currency Cloud API - https://www.currencycloud.com/developers/overview/'
10
10
  s.authors = ['Liam McAndrew', 'Richard Nienaber']
11
11
  s.email = ['liam.mcandrew@currencycloud.com', 'richard.nienaber@currencycloud.com']
12
- s.homepage = 'https://connect.currencycloud.com/documentation/getting-started/introduction'
12
+ s.homepage = 'https://github.com/Currencycloud/currencycloud-ruby/'
13
13
  s.licenses = ['MIT']
14
14
  s.required_ruby_version = '>= 1.9'
15
15
 
16
16
  s.add_dependency('httparty', '0.14.0')
17
17
  s.add_dependency('json', '~> 1.8')
18
18
 
19
- s.add_development_dependency('rspec', '~> 3.1')
20
- s.add_development_dependency('rake', '~> 10.3')
21
- s.add_development_dependency('webmock', '~> 1.21')
22
- s.add_development_dependency('vcr', '~> 2.9')
23
19
  s.add_development_dependency('addressable', '<= 2.4.0')
20
+ s.add_development_dependency('rake', '~> 10.3')
21
+ s.add_development_dependency('rspec', '~> 3.1')
22
+ s.add_development_dependency('vcr', '~> 3.0.3')
23
+ s.add_development_dependency('webmock', '~> 2.3.2')
24
24
 
25
25
  s.files = `git ls-files`.split("\n")
26
26
  s.test_files = `git ls-files -- spec/*`.split("\n")
27
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
27
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
28
28
  s.require_paths = ['lib']
29
29
  end
@@ -3,13 +3,13 @@ require_relative 'currency_cloud'
3
3
  require 'sinatra'
4
4
 
5
5
  get '/conversion' do
6
- conversion = CurrencyCloud::Conversion.create({
7
- buy_currency: params[:buy_currency],
6
+ conversion = CurrencyCloud::Conversion.create(
7
+ buy_currency: params[:buy_currency],
8
8
  sell_currency: params[:sell_currency],
9
- amount: params[:amount],
10
- fixed_side: 'buy',
11
- reason: 'test',
9
+ amount: params[:amount],
10
+ fixed_side: 'buy',
11
+ reason: 'test',
12
12
  term_agreement: true
13
- })
13
+ )
14
14
  "Conversion created: #{conversion.short_reference}"
15
- end
15
+ end
@@ -13,7 +13,11 @@ module CurrencyCloud
13
13
  end
14
14
 
15
15
  def build_url(url)
16
- "#{resource}/#{url}"
16
+ if url && url != '' && url != '/'
17
+ "#{resource}/#{url}"
18
+ else
19
+ "#{resource}"
20
+ end
17
21
  end
18
22
 
19
23
  def request
@@ -4,5 +4,20 @@ module CurrencyCloud
4
4
 
5
5
  resource :conversions
6
6
  actions :create, :retrieve, :find
7
+
8
+ def cancel(params = {})
9
+ attrs = client.post("#{id}/cancel", params)
10
+ ConversionCancelResult.new(attrs)
11
+ end
12
+
13
+ def date_change(params)
14
+ attrs = client.post("#{id}/date_change", params)
15
+ ConversionDateChangeResult.new(attrs)
16
+ end
17
+
18
+ def split(params)
19
+ attrs = client.post("#{id}/split", params)
20
+ ConversionSplitResult.new(attrs)
21
+ end
7
22
  end
8
23
  end
@@ -0,0 +1,5 @@
1
+ module CurrencyCloud
2
+ class ConversionCancelResult
3
+ include CurrencyCloud::Resource
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module CurrencyCloud
2
+ class ConversionDateChangeResult
3
+ include CurrencyCloud::Resource
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module CurrencyCloud
2
+ class ConversionSplitResult
3
+ include CurrencyCloud::Resource
4
+ end
5
+ end
@@ -33,7 +33,7 @@ module CurrencyCloud
33
33
  errors = raw_response.parsed_response
34
34
  @code = errors['error_code']
35
35
  @messages = []
36
-
36
+
37
37
  return unless errors['error_messages']
38
38
 
39
39
  errors['error_messages'].each do |field, messages|
@@ -62,7 +62,7 @@ module CurrencyCloud
62
62
  },
63
63
  'errors' => messages.map(&:to_h)
64
64
  }
65
- "#{class_name}#{$/}#{YAML.dump(error_details)}"
65
+ "#{class_name}#{$INPUT_RECORD_SEPARATOR}#{YAML.dump(error_details)}"
66
66
  end
67
67
  end
68
68
 
@@ -4,15 +4,15 @@ module CurrencyCloud
4
4
  base = "ruby-#{RUBY_VERSION}"
5
5
  implementation = case RUBY_ENGINE
6
6
  when 'ruby' then ''
7
- when 'jruby' then ' (jruby-#{JRUBY_VERSION})"'
8
- when 'rbx' then ' (rbx-#{Rubinius::VERSION})'
9
- else ' (other)'
7
+ when 'jruby' then " (jruby-#{JRUBY_VERSION})"
8
+ when 'rbx' then " (rbx-#{Rubinius::VERSION})"
9
+ else " (#{RUBY_ENGINE})"
10
10
  end
11
11
  "#{base}#{implementation}"
12
12
  end
13
13
 
14
14
  REDACTED_PARAMS = [:api_key, :login_id, :token].freeze
15
- REDACTED_STRING = "REDACTED".freeze
15
+ REDACTED_STRING = 'REDACTED'.freeze
16
16
 
17
17
  def redacted_params(params)
18
18
  redacted = params.dup
@@ -4,11 +4,11 @@ module CurrencyCloud
4
4
 
5
5
  attr_reader :inner_error
6
6
 
7
- def initialize(verb, route, params, e)
7
+ def initialize(verb, route, params, inner)
8
8
  @verb = verb
9
9
  @route = route
10
10
  @params = redacted_params(params)
11
- @inner_error = e
11
+ @inner_error = inner
12
12
  end
13
13
 
14
14
  def to_s
@@ -25,7 +25,7 @@ module CurrencyCloud
25
25
  },
26
26
  'inner_error' => inner_error.to_s
27
27
  }
28
- "#{class_name}#{$/}#{YAML.dump(error_details)}"
28
+ "#{class_name}#{$INPUT_RECORD_SEPARATOR}#{YAML.dump(error_details)}"
29
29
  end
30
30
  end
31
31
  end
@@ -0,0 +1,22 @@
1
+ module CurrencyCloud
2
+ class IBAN
3
+ include CurrencyCloud::Resource
4
+
5
+ resource :ibans
6
+
7
+ def self.find(params = {})
8
+ result = client.get('/', params)
9
+ IBANs.new(:ibans, self, result)
10
+ end
11
+
12
+ def self.for_subaccount(subaccount_id, params = {})
13
+ result = client.get("subaccounts/#{subaccount_id}", params)
14
+ IBANs.new(:ibans, self, result)
15
+ end
16
+
17
+ def self.for_subaccounts(params = {})
18
+ result = client.get('subaccounts/find', params)
19
+ IBANs.new(:ibans, self, result)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,6 @@
1
+ require 'currency_cloud/resourceful_collection'
2
+
3
+ module CurrencyCloud
4
+ class IBANs < CurrencyCloud::ResourcefulCollection
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module CurrencyCloud
2
+ class PayerRequiredDetails
3
+ include CurrencyCloud::Resource
4
+ end
5
+ end
@@ -4,5 +4,15 @@ module CurrencyCloud
4
4
 
5
5
  resource :payments
6
6
  actions :create, :retrieve, :find, :delete, :update
7
+
8
+ def submission(params = {})
9
+ result = client.get("#{id}/submission", params)
10
+ PaymentSubmission.new(result)
11
+ end
12
+
13
+ def self.authorise(*ids)
14
+ result = client.post("authorise", payment_ids: ids)['authorisations']
15
+ result.map { |pa| PaymentAuthorisationResult.new(pa) }
16
+ end
7
17
  end
8
18
  end
@@ -0,0 +1,5 @@
1
+ module CurrencyCloud
2
+ class PaymentAuthorisationResult
3
+ include CurrencyCloud::Resource
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module CurrencyCloud
2
+ class PaymentDates
3
+ include CurrencyCloud::Resource
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module CurrencyCloud
2
+ class PaymentSubmission
3
+ include CurrencyCloud::Resource
4
+ end
5
+ end