Skip to content

Instantly share code, notes, and snippets.

@nukturnal
Created April 6, 2013 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nukturnal/5325339 to your computer and use it in GitHub Desktop.
Save nukturnal/5325339 to your computer and use it in GitHub Desktop.
Code snippet shows how to perform an MPower DirectPay
<?php
require('mpower_php/mpower.php'); // Make sure the client library is relative to your path
MPower_Setup::setMasterKey("82403450-ee3a-4c57-9564-a8fbe30c5fb7");
MPower_Setup::setPublicKey("test_public_M6-fRS1RCnzlGqgeLaBF5vLLoKs");
MPower_Setup::setPrivateKey("test_private_jKxSn3ylcQdrQcuxAOFAbxvK5w4");
MPower_Setup::setMode("test");
MPower_Setup::setToken("7f6c81c1ea223674416e");
$direct_pay = new MPower_DirectPay();
if ($direct_pay->creditAccount("your_test_account_username",70.65)) {
print $direct_pay->description;
print $direct_pay->response_text;
print $direct_pay->transaction_id;
}else{
print $direct_pay->response_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment