private function initialize() { \MPower_Setup::setMasterKey("da1666f2-fb46-4fa2-b3ca-194992922f49"); \MPower_Setup::setPublicKey("test_public_SgwQ0HO892lCaCGXg2r3kF85o7M"); \MPower_Setup::setPrivateKey("test_private_7eyIvdfBBoUBubMSV4hcqEvQm14"); \MPower_Setup::setMode("test"); \MPower_Setup::setToken("2a4b2b1b9cbf8649e69b"); // Return url \MPower_Checkout_Store::setReturnUrl(url('order/feedback/' . PaymentMethod::PAYMENT_MPOWER)); \MPower_Checkout_Store::setName("MediBig.com"); \MPower_Checkout_Store::setTagline("I can also buy it!"); \MPower_Checkout_Store::setPhoneNumber("0501373573"); //\MPower_Checkout_Store::setPostalAddress("Post office Box AN 10604"); $this->invoice = new \MPower_Checkout_Invoice(); }
<?php require 'mpower_php/mpower.php'; // Make sure the client library is relative to your path MPower_Setup::setMasterKey("dd6f2c90-f075-012f-5b69-00155d866600"); MPower_Setup::setPublicKey("live_public_DP2tNf1X2NHWIE4EN1Ep3FCPKXc"); MPower_Setup::setPrivateKey("live_private_HSJ-DYh7jdiqnqIvDW_X3F4kE8k"); MPower_Setup::setMode("live"); MPower_Setup::setToken("e179a0d8f07ef0078e38"); $direct_pay = new MPower_DirectPay(); if ($direct_pay->creditAccount("0244124660", 70.65000000000001)) { print $direct_pay->description; print $direct_pay->response_text; print $direct_pay->transaction_id; } else { print $direct_pay->response_text; }
} else { //echo "No data Posted"; //die; } echo "<img src='final.gif' width='100%' height='780' />"; sleep(3); //die; $live = !false; if ($live == false) { MPower_Setup::setMasterKey("90a2f8a1-7f7b-471f-bdb4-268a270985d4"); MPower_Setup::setPublicKey("test_public_rg2qugm3CWU2J-xvi14KE4-AYGY"); MPower_Setup::setPrivateKey("test_private_eBw1XNZOWtx8XTvDMuZCDZot8I4"); MPower_Setup::setMode("test"); MPower_Setup::setToken("0b8275226b2ec2da5458"); } else { MPower_Setup::setMasterKey("90a2f8a1-7f7b-471f-bdb4-268a270985d4"); MPower_Setup::setPublicKey("live_public_qj5brK9VO3LbA8xSPE8IPtyExf4"); MPower_Setup::setPrivateKey("live_private_b1wT60n7jXB4zlMaC67gIjNDC3s"); MPower_Setup::setMode("live"); MPower_Setup::setToken("314891080ac32d5c94de"); } // Configure Checkout Store MPower_Checkout_Store::setName("CND GLOBAL FASHION"); MPower_Checkout_Store::setTagline("A Touch Of African Fashion"); MPower_Checkout_Store::setPhoneNumber("+3361877452626/+336752517819"); MPower_Checkout_Store::setPostalAddress("130 Grande Rue 92310 \n Paris Servres"); //$invoice = new MPower_Checkout(); $invoice = new MPower_Checkout_Invoice(); $invoice->setCancelUrl("http://www.cndglobalfashion.com/Mpower/Cancel.php"); $invoice->setReturnUrl("http://www.cndglobalfashion.com/Mpower/Success.php"); /* Adding items to your invoice is very basic, the parameters expected are