Class: Elements::ApiV1
Overview
ApiV1 class uses the older v1 version of the elements Api
Class Method Summary collapse
-
.find_currencies ⇒ Object
Find Currencies is a class method that returns all the currencies added to Elements.
-
.find_currency(currency) ⇒ Object
Find currency is a class method that finds a particular currency depending on the currency name or elements_id.
-
.update_user(user, ipaddress = '123.123.123.123') ⇒ Object
Update_user method updates the user information using elements API.
Methods inherited from Api
add_forex_offer, add_user, buy_purchase_info, cancel_forex_offer, cancel_purchase_order, cashin_purchase_info, create_account, create_purchase_order, exchange_purchase_info, fetch_order_elements, find_account_name, find_active_forex_offer, find_balance, find_forex_offer_by_currency, find_forex_offer_by_external_key, find_forex_offer_by_id, find_or_create_forex_offer, find_purchase_order, find_user, process_purchase_order, save_order_elements, sell_purchase_info, set_account_balance
Class Method Details
.find_currencies ⇒ Object
Find Currencies is a class method that returns all the currencies added to Elements
376 377 378 |
# File 'lib/elements.rb', line 376 def self.find_currencies get_data('currency') end |
.find_currency(currency) ⇒ Object
Find currency is a class method that finds a particular currency depending on the currency name or elements_id
381 382 383 384 385 386 387 388 |
# File 'lib/elements.rb', line 381 def self.find_currency(currency) params = if(currency.elements_id.blank?) {"currency.name" => currency.vcx_name} else {"currency.id" => currency.elements_id} end get_data('currency', params) end |
.update_user(user, ipaddress = '123.123.123.123') ⇒ Object
Update_user method updates the user information using elements API
364 365 366 367 368 369 370 371 372 373 |
# File 'lib/elements.rb', line 364 def self.update_user(user, ipaddress='123.123.123.123') params = { 'user.id' => user.elements_id, 'ipAddress' => ipaddress, 'user.emailAddress' => user.email, 'user.gender' => user.gender[0], 'user.dateOfBirth' => user.dob.strftime("%Y/%m/%d") } post_data 'user/update', params end |