Class: Moneta::Api::Service

Inherits:
Object
  • Object
show all
Includes:
ServiceMethods
Defined in:
lib/moneta/api/service.rb

Constant Summary collapse

DEMO =
Moneta::Constants::Settings::DEMO
PRODUCTION =
Moneta::Constants::Settings::PRODUCTION
URL =
Moneta::Constants::Settings::SERVICES_PATH

Instance Method Summary collapse

Methods included from ServiceMethods

#approve_phone_apply_code, #approve_phone_send_confirmation, #authorise_transaction, #authorise_transaction_batch, #cancel_transaction, #cancel_transaction_batch, #confirm_transaction, #confirm_transaction_batch, #create_account, #create_bank_account, #create_profile, #edit_bank_account, #edit_profile, #find_account_by_alias, #find_account_by_id, #find_accounts_list, #find_bank_accounts, #find_last_operations_list, #find_operations_list, #forecast_transaction, #get_account_payment_password_challenge, #get_operation_details_by_id, #get_profile_info, #invoice, #invoice_batch, #payment, #refund, #transfer, #transfer_batch, #verify_payment, #verify_payment_batch, #verify_transaction, #verify_transfer

Constructor Details

#initialize(username, password, params = {}) ⇒ Service

Returns a new instance of Service.



10
11
12
13
14
# File 'lib/moneta/api/service.rb', line 10

def initialize(username, password, params = {})
  @username = username
  @password = password
  @connection = connection(Options.new(params))
end

Instance Method Details

#call_method(method_id, request) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/moneta/api/service.rb', line 16

def call_method(method_id, request)
  @connection.post do |req|
    req.url URL
    req.headers['Content-Type'] = 'application/json;charset=UTF-8'
    req.body = request_body(method_id, request).to_json
  end
end