Class: Musoni::Transaction
- Defined in:
- lib/musoni_ruby/endpoints/transaction.rb
Instance Attribute Summary
Attributes inherited from Endpoint
#attributes, #config, #endpoint, #id, #pagination, #response
Class Method Summary collapse
-
.transfer(options = {}) ⇒ Object
move to own endpoint from_account = 1,fromClientId: 1,fromAccountType: 2,fromAccountId: 1 to_account = 1,toClientId: 1,toAccountType: 1,toAccountId: 9 Musoni::SavingsAccount.transfer(from_account.merge!(to_account).merge!(transferAmount:100,transferDescription:“transfering”).
- .transfer_options(options) ⇒ Object
Methods inherited from Endpoint
#fail?, #initialize, #success?
Constructor Details
This class inherits a constructor from Musoni::Endpoint
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Musoni::Endpoint
Class Method Details
.transfer(options = {}) ⇒ Object
move to own endpoint from_account = 1,fromClientId: 1,fromAccountType: 2,fromAccountId: 1 to_account = 1,toClientId: 1,toAccountType: 1,toAccountId: 9 Musoni::SavingsAccount.transfer(from_account.merge!(to_account).merge!(transferAmount:100,transferDescription:“transfering”)
20 21 22 23 24 25 26 |
# File 'lib/musoni_ruby/endpoints/transaction.rb', line 20 def transfer(={}) = () url = "/accounttransfers" [:transferDate] = Time.zone.now response = Musoni::Fetch.post(url,) new(.merge!(id:response.resourceId ,response:response)) rescue response end |
.transfer_options(options) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/musoni_ruby/endpoints/transaction.rb', line 7 def () # TODO Have actual object as inputs like account1 and account2 .merge!([:to] || {}).merge!([:from] || {}) [:transferAmount] ||= [:amount] [:transferDescription] ||= [:description] [:to,:from,:amount,:description].each { |k| .delete k } end |