Skip to content

Commit

Permalink
Final version: Merged holder.html contents with api.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonio committed Feb 15, 2015
1 parent 47618f7 commit f2c18e5
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 72 deletions.
95 changes: 69 additions & 26 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_once("afterpay/lib/Afterpay/Afterpay.php");

ini_set('error_reporting', E_STRICT);
process();
//process();


function process(){
Expand All @@ -24,7 +24,7 @@ function process(){
$sku = 'PRODUCT1';
$name = 'Product name 1';
$qty = 1;
$price = 3000; // in cents
$price = 1000; // in cents
$tax_category = 1; // 1 = high, 2 = low, 3, zero, 4 no tax
$Afterpay->create_order_line( $sku, $name, $qty, $price, $tax_category );

Expand All @@ -35,7 +35,7 @@ function process(){
$qty = 1;
$price = 30; // in cents
$tax_category = 1; // 1 = high, 2 = low, 3, zero, 4 no tax
$Afterpay->create_order_line( $sku, $name, $qty, $price, $tax_category );
// $Afterpay->create_order_line( $sku, $name, $qty, $price, $tax_category );

//
// Set up the bill to address
Expand Down Expand Up @@ -114,17 +114,17 @@ function process(){
$invLine[$i]["articleID"] = "articleID " . $i;

$invLine[$i]["quantity"] = "1 ";
$invLine[$i]["unitprice"] = 1000;
$invLine[$i]["unitprice"] = 200;
$invLine[$i]["vatcategory"] =1;
$invLine[$i]["articleID"] = "articleID " . $i;

$Afterpay->create_order_line( "sku", "abc", 1, 1000, 1 );
$Afterpay->create_order_line( "sku", "abc", 1, 200, 1 );
}
// Capture
//

$tid = array();
for($i = 0; $i<3; $i++) {
for($i = 0; $i<5; $i++) {
$cap["Invoicelines"] = $invLine;
$cap["invoicenumber"] = $orderNo.$i;
$cap["ordernumber"] = $orderNo;
Expand All @@ -141,7 +141,7 @@ function process(){
$result =$Afterpay->order_result;


echo "<p/>";
// echo "<p/>";

//var_dump($result);
$tid[$i] = $result->return->transactionId;
Expand All @@ -151,39 +151,82 @@ function process(){

}
// var_dump($tid);
echo json_encode($tid);

echo "<li class='row'><span class='quantity col-md-1'>1</span><span class='itemName col-md-5'>AfterPay ";
echo json_encode($tid[0]);
echo "</span><span class='itemName col-md-3'>25/02/2015</span><span class='popbtn'><a class='arrow'></a></span><span class='price col-md-2'>£200.00</span></li>";

echo "<li class='row'><span class='quantity col-md-1'>1</span><span class='itemName col-md-5'>AfterPay ";
echo json_encode($tid[1]);
echo "</span><span class='itemName col-md-3'>05/03/2015</span><span class='popbtn'><a class='arrow'></a></span><span class='price col-md-2'>£200.00</span></li>";

echo "<li class='row'><span class='quantity col-md-1'>1</span><span class='itemName col-md-5'>AfterPay ";
echo json_encode($tid[2]);
echo "</span><span class='itemName col-md-3'>15/03/2015</span><span class='popbtn'><a class='arrow'></a></span><span class='price col-md-2'>£200.00</span></li>";

echo "<li class='row'><span class='quantity col-md-1'>1</span><span class='itemName col-md-5'>AfterPay ";
echo json_encode($tid[3]);
echo "</span><span class='itemName col-md-3'>25/03/2015</span><span class='popbtn'><a class='arrow'></a></span><span class='price col-md-2'>£200.00</span></li>";

echo "<li class='row'><span class='quantity col-md-1'>1</span><span class='itemName col-md-5'>AfterPay ";
echo json_encode($tid[4]);
echo "</span><span class='itemName col-md-3'>05/04/2015</span><span class='popbtn'><a class='arrow'></a></span><span class='price col-md-2'>£200.00</span></li>";


// echo $orderNo;

}

//var_dump();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Shopping Cart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/custom.css"/>
</head>

/// ORDER
<body>

// Set up the additional information
// $aporder['ordernumber'] = 'ORDER123';
// $aporder['bankaccountnumber'] = '12345'; // or IBAN 'NL32INGB0000012345';
// $aporder['currency'] = 'EUR';
//$aporder['ipaddress'] = "5.79.64.0";//$_SERVER['REMOTE_ADDR'];
<nav class="navbar" >
<div class="container">
<a class="navbar-brand" href="file:///Users/hoonio/Developer/SaaS/index.html">SaaS</a>
<div class="navbar-right">
<div class="container minicart"></div>
</div>
</div>
</nav>

// "captureFull'
// Create the order object for B2C or B2B
// var_dump($Afterpay);
<div class="container text-center" style="margin-top: 100px;">

<div class="col-md-12 text-left">
<ul>
<li class="row list-inline columnCaptions ">
<span class="col-md-1">QTY</span>
<span class="col-md-4">ITEM</span>
<span class="col-md-4">Scheduled Payment</span>
<span class="col-md-2">Price</span>
<span class="col-md-1"></span>
</li>

// Invoice Lines
<?php process();?>

<li class="row totals">
<span class="itemName">Total:</span>
<span class="price">£1000.00</span>
<span class="order"> <a class="text-center" href="#">Confirm</a></span>
</li>

//echo $aporder->getInvoicenumber;
</ul>
</div>

// var_dump($aporder);
// Capture Object
</div>

//Capture Object End
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/customjs.js"></script>

//var_dump($Afterpay->order_result);
</body>
</html>
64 changes: 28 additions & 36 deletions holder.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<nav class="navbar" >
<div class="container">
<a class="navbar-brand" href="#">SaaS</a>
<a class="navbar-brand" href="file:///Users/hoonio/Developer/SaaS/index.html">SaaS</a>
<div class="navbar-right">
<div class="container minicart"></div>
</div>
Expand All @@ -29,71 +29,63 @@
</ol>
</div> -->

<div class="container text-center" >
<div class="container text-center" style="margin-top: 100px;">

<div class="col-md-6 text-left">
<div class="col-md-12 text-left">
<ul>
<li class="row list-inline columnCaptions ">
<span>QTY</span>
<span>ITEM</span>
<span>Date Payment Due</span>
<span>Price</span>
<span class="col-md-1">QTY</span>
<span class="col-md-4">ITEM</span>
<span class="col-md-4">Scheduled Payment</span>
<span class="col-md-2">Price</span>
<span class="col-md-1"></span>
</li>
<li class="row">
<span class="quantity">1</span>
<span class="itemName">Willy Wonka Airline Ticket</span>
<div class="col-md-3"> <span class="itemName">25/02/2015</span> </div>
<span class="quantity col-md-1">1</span>
<span class="itemName col-md-5">AfterPay 392151</span>
<span class="itemName col-md-3">25/02/2015</span>
<span class="popbtn"><a class="arrow"></a></span>
<span class="price">£100.00</span>
<span class="price col-md-2">£200.00</span>
</li>
<li class="row">
<span class="quantity">1</span>
<span class="itemName">Willy Wonka Airline Ticket</span>
<div class="col-md-3"> <span class="itemName">05/03/2015</span> </div>
<span class="quantity col-md-1">1</span>
<span class="itemName col-md-5">AfterPay 392152</span>
<span class="itemName col-md-3">05/03/2015</span>
<span class="popbtn"><a class="arrow"></a></span>
<span class="price">£100.00</span>
<span class="price col-md-2">£200.00</span>
</li>
<li class="row">
<span class="quantity">1</span>
<span class="itemName">Willy Wonka Airline Ticket</span>
<div class="col-md-3"> <span class="itemName">15/03/2015</span> </div>
<span class="quantity col-md-1">1</span>
<span class="itemName col-md-5">AfterPay 392153</span>
<span class="itemName col-md-3">15/03/2015</span>
<span class="popbtn"><a class="arrow"></a></span>
<span class="price">£100.00</span>
<span class="price col-md-2">£200.00</span>
</li>
<li class="row">
<span class="quantity">1</span>
<span class="itemName">Willy Wonka Airline Ticket</span>
<div class="col-md-3"> <span class="itemName">25/03/2015</span> </div>
<span class="quantity col-md-1">1</span>
<span class="itemName col-md-5">AfterPay 392154</span>
<span class="itemName col-md-3">25/03/2015</span>
<span class="popbtn"><a class="arrow"></a></span>
<span class="price">£100.00</span>
<span class="price col-md-2">£200.00</span>
</li>
<li class="row">
<span class="quantity">1</span>
<span class="itemName">Willy Wonka Airline Ticket</span>
<div class="col-md-3"> <span class="itemName">05/04/2015</span> </div>
<span class="quantity col-md-1">1</span>
<span class="itemName col-md-5">AfterPay 392155</span>
<span class="itemName col-md-3">05/04/2015</span>
<span class="popbtn"><a class="arrow"></a></span>
<span class="price">£100.00</span>
<span class="price col-md-2">£200.00</span>
</li>
<li class="row totals">
<span class="itemName">Total:</span>
<span class="price">£1000.00</span>
<span class="order"> <a class="text-center" href="http://localhost:4000/api.php">Confirm AfterPay Strip</a></span>
=
</li>
</ul>
</div>

</div>

<!-- The popover content -->

<div id="popover" style="display: none">
<a href="#"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="#"><span class="glyphicon glyphicon-remove"></span></a>
</div>

<!-- JavaScript includes -->

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/customjs.js"></script>
Expand Down
20 changes: 10 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/custom.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/custom.css"/>
</head>

<body>

<nav class="navbar">
<div class="container">
<a class="navbar-brand" href="#">Surprise as a Service [SaaS] </a>
Expand All @@ -19,15 +19,15 @@
</div>
</div>
</nav>

<div class="container-fluid breadcrumbBox text-center">
<ol class="breadcrumb">
<li><a href="#">Review</a></li>
<li class="active"><a href="#">Order</a></li>
<li><a href="#">Payment</a></li>
</ol>
</div>

<div class="container text-center">

<div class="col-md-5 col-sm-12">
Expand All @@ -36,7 +36,7 @@ <h1>Our Shopping Cart</h1>
<p>
</p>
</div>

<div class="col-md-7 col-sm-12 text-left">
<ul>
<li class="row list-inline columnCaptions">
Expand All @@ -53,8 +53,8 @@ <h1>Our Shopping Cart</h1>
<li class="row totals">
<span class="itemName">Total:</span>
<span class="price">£1000.00</span>
<span class="order"> <a class="text-center" href="holder.html">AfterPay</a></span>
<span class="order"> <a class="text-center">MasterCard</a></span>
<span class="order"> <a class="text-center" href="http://localhost:4000/api.php">AfterPay</a></span>
<span class="order"> <a class="text-center" href="holder.html">MasterCard</a></span>

</li>
</ul>
Expand All @@ -68,12 +68,12 @@ <h1>Our Shopping Cart</h1>
<a href="#"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="#"><span class="glyphicon glyphicon-remove"></span></a>
</div>

<!-- JavaScript includes -->

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/customjs.js"></script>

</body>
</html>
</html>

0 comments on commit f2c18e5

Please sign in to comment.