<?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;
}
예제 #2
0
파일: Payments.php 프로젝트: tynawood/rm
$query = mysql_query($sql);
/*
if(mysql_num_rows($query)){}
print_r($sql.$ids);
die;
*/
while ($row = mysql_fetch_assoc($query)) {
    $total += $row['product_price'] * $_SESSION['qty'][$q];
    $tax = 2 / 100 * $row['product_price'] * $_SESSION['qty'][$q];
    $invoice->addItem($row['product_name'], $_SESSION['qty'][$q], $row['product_price'], $row['product_price'] * $_SESSION['qty'][$q]);
}
//$invoice->addItem("Case Logic laptop Bag",2,100.50,201,"Optional description");
//$invoice->addItem("Philips electric shaver",2,50.50,101.00);
/* You can optionally set a general invoice description text which can
		be used in cases where your invoice does not need an items list or in cases
		where you need to include some extra descriptive information to your invoice */
$invoice->setDescription("Please Confirm Your Order");
$invoice->setTotalAmount($total);
if ($invoice->create()) {
    //header("Location: ".getDirectCreditcardChargeUrl();
    header("Location: " . $invoice->getInvoiceUrl() . "#debitcard");
} else {
    echo $invoice->response_text;
}
/*if($invoice->confirm($invoice->token)){
		
		echo $invoice->token;
		}*/
?>
</body>
</html>