Created
April 6, 2013 07:54
-
-
Save nukturnal/5325339 to your computer and use it in GitHub Desktop.
Code snippet shows how to perform an MPower DirectPay
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 | |
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