Module: MangoApi::EMoney
- Extended by:
- UriProvider
- Defined in:
- lib/mangopay/api/service/e_money.rb
Overview
Provides API method delegates concerning the EMoney
entity
Class Method Summary collapse
-
.of_user_month(user_id, year, month, currency = nil) ⇒ EMoney
Retrieves a user’s e-money for year/month.
-
.of_user_year(user_id, year, currency = nil) ⇒ EMoney
Retrieves a user’s e-money for year.
Methods included from UriProvider
Class Method Details
.of_user_month(user_id, year, month, currency = nil) ⇒ EMoney
Retrieves a user’s e-money for year/month.
defaults to EUR.
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/mangopay/api/service/e_money.rb', line 39 def of_user_month(user_id, year, month, currency = nil) uri = provide_uri(:get_users_e_money_month, user_id, year, month) if currency response = HttpClient.get_raw(uri) do |request| HttpClient.api_headers.each {|k, v| request.add_field(k, v)} request.body = CurrencyRequest.new(currency).jsonify! end else response = HttpClient.get(uri) end parse response end |
.of_user_year(user_id, year, currency = nil) ⇒ EMoney
Retrieves a user’s e-money for year.
defaults to EUR.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mangopay/api/service/e_money.rb', line 18 def of_user_year(user_id, year, currency = nil) uri = provide_uri(:get_users_e_money_year, user_id, year) if currency response = HttpClient.get_raw(uri) do |request| HttpClient.api_headers.each {|k, v| request.add_field(k, v)} request.body = CurrencyRequest.new(currency).jsonify! end else response = HttpClient.get(uri) end parse response end |