Class: Mpayer::Transaction

Inherits:
Base
  • Object
show all
Defined in:
lib/mpayer/transaction.rb

Instance Attribute Summary

Attributes inherited from Base

#base_url, #mpayer_token, #user_no

Instance Method Summary collapse

Methods inherited from Base

#auth, #delete, #get, #initialize, #parse_api_response, #post, #put

Constructor Details

This class inherits a constructor from Mpayer::Base

Instance Method Details

#allObject

GET /transactions/all



5
6
7
# File 'lib/mpayer/transaction.rb', line 5

def all
	get('/transactions/all')
end

#deposit(json_body) ⇒ Object

PUT /transactions/deposit ‘ref_id: ’this is a unique field for every transaction(can be used to id a transaction)‘ `amount: ’this is the amount being transfered’ ‘cr_party: ’this is the recipient(can be an account number or a payable number)‘ when it is a payable number a ’#‘ is prepended to indicate: deposit as per the propotions in the payable example => amount:“200”, cr_party:“#GOGXWP”



18
19
20
# File 'lib/mpayer/transaction.rb', line 18

def deposit(json_body)
	put('/transactions/deposit', json_body)
end

#transfer(json_body) ⇒ Object

POST /transactions/transfer Parameters [all the listed parameters are manadatory] ‘ref_id: ’this is a unique field for every transaction(can be used to id a transaction)‘ `amount: ’this is the amount being transfered’ ‘cr_party: ’this is the recipient(can be an account number or a payable number)‘ `dr_party: ’this is the sender’ when it is a payable number a ‘#’ is prepended to indicate pay. example: ==> cr_party:“#GOGXWP”, dr_party:“0004354652927”



47
48
49
# File 'lib/mpayer/transaction.rb', line 47

def transfer(json_body)
	post('/transactions/transfer', json_body)
end

#withdraw(json_body) ⇒ Object

POST /transactions/withdraw Parameters [all the listed parameters are manadatory] ‘ref_id: ’this is a unique field for every transaction(can be used to id a transaction)‘ `amount: ’this is the amount being transfered’ ‘dr_party: ’this is the sender’ ‘cr_party: ’this is the recipient(can be an account number or a payable number)‘ when it is a payable number a ’#‘ is prepended to indicate: withdraw as per the propotions in the payable example=> ref_id:“345345244545345”,amount:“10”,cr_party:“#GOGXWP”,dr_party:“00043230652927”



33
34
35
# File 'lib/mpayer/transaction.rb', line 33

def withdraw(json_body)
	post('/transactions/withdraw', json_body)
end