Class: ShieldPay::Transaction
- Inherits:
-
Object
- Object
- ShieldPay::Transaction
- Extended by:
- Helpers
- Defined in:
- lib/shieldpay/transaction.rb
Instance Attribute Summary collapse
-
#status_id ⇒ Object
Returns the value of attribute status_id.
Class Method Summary collapse
-
.change_status(input_params) ⇒ Object
Webhook Params Parameter Optional? Description customer_id no The customer id of either the sender or the receiver of this transaction transaction_id no The transaction id to change status status_id no The status to change to.
-
.get_status(input_params = {}) ⇒ Object
Webhook Params Parameter Optional? Description customer_id no The customer id of either the sender or the receiver of this transaction transaction_id no The transaction id to look up.
Methods included from Helpers
stringify_keys, stringify_keys!
Instance Attribute Details
#status_id ⇒ Object
Returns the value of attribute status_id.
5 6 7 |
# File 'lib/shieldpay/transaction.rb', line 5 def status_id @status_id end |
Class Method Details
.change_status(input_params) ⇒ Object
Webhook Params Parameter Optional? Description customer_id no The customer id of either the sender or the
receiver of this transaction
transaction_id no The transaction id to change status status_id no The status to change to
25 26 27 28 29 30 31 |
# File 'lib/shieldpay/transaction.rb', line 25 def self.change_status(input_params) stringify_keys!(input_params) input_params["transaction_status_id"] = input_params.delete("status_id") response = Request.new.post("/Transaction/ChangePaymentStatus", input_params) response.dig("coreRes", "status") == 1 end |
.get_status(input_params = {}) ⇒ Object
Webhook Params Parameter Optional? Description customer_id no The customer id of either the sender or the
receiver of this transaction
transaction_id no The transaction id to look up
13 14 15 16 17 |
# File 'lib/shieldpay/transaction.rb', line 13 def self.get_status(input_params={}) stringify_keys!(input_params) response = Request.new.post("/Transaction/GetPaymentStatus", input_params) response.dig("Data", "StatusId") end |