lib/mpower/direct_pay.rb in mpower-1.2.0 vs lib/mpower/direct_pay.rb in mpower-1.2.1

- old
+ new

@@ -1,26 +1,19 @@ module MPower - class DirectPay - include MPower::Utilities - attr_accessor :status, :response_text, :response_code, :transaction_id, :description + class DirectPay < MPower::Checkout::Core def credit_account(payee_account,amount) payload = { :account_alias => payee_account, :amount => amount } result = http_json_request(MPower::Setup.direct_pay_credit_base_url,payload) if result["response_code"] == "00" - @transaction_id = result["transaction_id"] - @description = result["description"] - @response_code = result["response_code"] - @status = MPower::SUCCESS + push_results(result) true else - @response_text = result["response_text"] - @response_code = result["response_code"] - @status = MPower::FAIL + push_results(result) false end end end end \ No newline at end of file