Class: Ipay::Rest::TransactionResource
- Defined in:
- lib/ipay/rest/resources/transaction.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #initiate(oid:, inv:, amount:, tel:, eml:, cbk:, **params) ⇒ Object
- #push(channel:, phone:, sid:) ⇒ Object
- #search(oid:) ⇒ Object
- #status(sid:) ⇒ Object
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Ipay::Rest::Resource
Instance Method Details
#initiate(oid:, inv:, amount:, tel:, eml:, cbk:, **params) ⇒ Object
4 5 6 7 |
# File 'lib/ipay/rest/resources/transaction.rb', line 4 def initiate(oid:, inv:, amount:, tel:, eml:, cbk:, **params) body = initiate_params.merge({oid: oid, inv: inv, amount: amount, tel: tel, eml: eml, cbk: cbk}, params) Initiator.new post("transact", body: body).body end |
#push(channel:, phone:, sid:) ⇒ Object
19 20 21 22 |
# File 'lib/ipay/rest/resources/transaction.rb', line 19 def push(channel:, phone:, sid:) body = push_params.merge({phone: phone, sid: sid}) UssdPush.new post("transact/push/#{channel}", body: body).body end |
#search(oid:) ⇒ Object
14 15 16 17 |
# File 'lib/ipay/rest/resources/transaction.rb', line 14 def search(oid:) body = search_params.merge({oid: oid}) Transaction.new post("transaction/search", body: body).body end |
#status(sid:) ⇒ Object
9 10 11 12 |
# File 'lib/ipay/rest/resources/transaction.rb', line 9 def status(sid:) body = status_params.merge({sid: sid}) TransactionStatus.new post("transact/mobilemoney", body: body).body end |