lib/mpower/direct_mobile.rb in mpower-1.2.2 vs lib/mpower/direct_mobile.rb in mpower-1.2.3
- old
+ new
@@ -1,21 +1,13 @@
module MPower
class DirectMobile < MPower::Checkout::Core
attr_accessor :mobile_invoice_no, :tx_status, :cancel_reason
def charge(amount,customer_details={})
- payload = {
- :customer_name => customer_details[:customer_name],
- :customer_phone => customer_details[:customer_phone],
- :customer_email => customer_details[:customer_email],
- :wallet_provider => customer_details[:wallet_provider],
- :merchant_name => customer_details[:merchant_name],
- :amount => amount
- }
+ customer_details[:amount] = amount
+ result = http_json_request(MPower::Setup.direct_mobile_charge_base_url,customer_details)
- result = http_json_request(MPower::Setup.direct_mobile_charge_base_url,payload)
-
if result["response_code"] == "00"
@mobile_invoice_no = result["mobile_invoice_no"]
push_results(result)
true
else
@@ -39,6 +31,6 @@
push_results(result)
false
end
end
end
-end
\ No newline at end of file
+end