Exemplo n.º 1
0
<?php

require 'conf.php';
$co = new MPower_Onsite_Invoice();
// Pass the account alias as a create function parameter
if ($co->charge($_POST["opr_token"], $_POST["confirmation_code"])) {
    echo $co->response_text;
    echo "<br/> Reciept Link <a href=\"" . $co->getReceiptUrl() . "\">Download</a>";
} else {
    echo $co->response_text;
}
?>
<br/>
<br/>
<a href="index2.php?reset=ok" title="">Back to Cart page</a>

<?php

session_start();
require 'conf.php';
$co = new MPower_Onsite_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);
// Pass the account alias as a create function parameter
if ($co->create($_POST["account_alias"])) {
    // header("Location: ".$co->getInvoiceUrl());
} else {
    exit($co->response_text);
}
?>
<html>
<head>
  <title>Onsite Checkout Request</title>
  <style type="text/css">
    body{
      background-color: #272727;
      font-family: Arial;
      font-size: 14px;
    }
    h1{
      font-weight: 500;
    }
    .container{