Last active
April 13, 2017 19:41
-
-
Save worla/f82898ef7930c2dcaaf9f998a72f58b6 to your computer and use it in GitHub Desktop.
Mobile Money Payment Without cURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = array ( | |
"customer_name" => "worla", | |
"customer_phone" => "0546652999", | |
"customer_email" => "[email protected]", | |
"wallet_provider" => "MTN", | |
"merchant_name" => "Creators Hub", | |
"amount" => "1", | |
); | |
$url = "https://app.mpowerpayments.com/api/v1/direct-mobile/charge"; | |
$opts = array('http' => | |
array( | |
'method' => 'POST', | |
'header' => "Content-Type: application/json\r\n" . "MP-Master-Key: arj67js7-g45n-1o1k-099t-5s7d8g8g0a73nx\r\n" . "MP-Private-Key: live_private_Hri2vBoqen5alM9c_4IvbbBqweersdFGH\r\n" . "MP-Token: 123asdt4ki85g12m9084r\r\n", | |
'content' => json_encode($data) | |
) | |
); | |
$context = stream_context_create($opts); | |
$result = file_get_contents($url, false, $context); | |
var_dump($result); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment