*
 *
 *
 * @author     Shane Barron <*****@*****.**>
 * @author     Aaustin Barron <*****@*****.**>
 * @copyright  2015 SocialApparatus
 * @license    http://opensource.org/licenses/MIT MIT
 * @version    1
 * @link       http://socialapparatus.com
 */
namespace SocialApparatus;

denyDirect();
\Stripe\Stripe::setApiKey(EcommercePlugin::secretKey());
$order_id = pageArray(1);
$order = \Stripe\Order::retrieve($order_id);
echo "<table class='table table-striped table-hover table-bordered'>";
echo "<tr>";
echo "<th>Date</th>";
echo "<th>Order ID</th>";
echo "<th>Description</th>";
echo "<th>Amount</th>";
echo "<th>Download</th>";
echo "</tr>";
foreach ($order->items as $item) {
    if ($item->description != "Taxes (included)" && $item->description != "Free shipping") {
        $sku = $item->parent;
        $product = getEntity(array("type" => "Product", "metadata_name" => "stripe_sku", "metadata_value" => $sku));
        echo "<tr>";
        echo "<td>";
        echo date("m/d/Y", $order->created);