Class: MPower::DirectCard
- Inherits:
-
Checkout::Core
- Object
- Checkout::Core
- MPower::DirectCard
- Defined in:
- lib/mpower/direct_card.rb
Instance Attribute Summary collapse
-
#unity_transaction_id ⇒ Object
Returns the value of attribute unity_transaction_id.
Attributes inherited from Checkout::Core
#description, #invoice_token, #response_code, #response_text, #result, #status, #token, #transaction_id
Instance Method Summary collapse
Methods inherited from Checkout::Core
Methods included from Utilities
#hash_to_json, #http_get_request, #http_json_request, #json_to_hash
Instance Attribute Details
#unity_transaction_id ⇒ Object
Returns the value of attribute unity_transaction_id.
3 4 5 |
# File 'lib/mpower/direct_card.rb', line 3 def unity_transaction_id @unity_transaction_id end |
Instance Method Details
#charge(amount, card_details = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/mpower/direct_card.rb', line 5 def charge(amount,card_details={}) card_details[:amount] = amount result = http_json_request(MPower::Setup.direct_card_charge_base_url,card_details) if result["response_code"] == "00" push_results(result) @unity_transaction_id = result["unity_transaction_id"] true else push_results(result) false end end |