<?php require 'conf.php'; $co = new MPower_Checkout_Invoice(); ?> <html> <head> <title>Awesome Online Store</title> <style type="text/css"> body{ background-color: #272727; font-family: Arial; font-size: 14px; } h1{ font-weight: 500; } .container{ margin:60px auto 0 auto; width:600px; min-height: 400px; background-color: #fafafa; border: 1px solid #e4e4e4; padding: 15px 30px; } input[type="text"]{ padding:4px; display: block; width:300px; margin-bottom: 8px; }
<?php session_start(); require 'conf.php'; $co = new MPower_Checkout_Invoice(); $total_amount = 0; foreach ($_SESSION["cart"] as $product) { $co->addItem($product['name'], $product['quantity'], $product['unit_price'], $product['total_price']); $total_amount += $product['total_price']; } $co->setTotalAmount($total_amount); if ($co->create()) { header("Location: " . $co->getInvoiceUrl()); } else { echo $co->response_text; }
function __construct() { parent::__construct(); }
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 name_of_item, quantity, unit_price, total_price and optional item description. */ @session_start(); //@session_destroy(); $i = 0; $ids = ""; $q = 0; $total = 0.0; $tax = 2.0; for (; $i < count($_SESSION['cartid']); $i++) { $ids .= " id =" . $_SESSION['cartid'][$i]; if ($i + 1 < count($_SESSION['cartid'])) {