<?php

require_once __DIR__ . "/vendor/autoload.php";
require_once __DIR__ . "/settings.php";

\Sentry\init([
    'dsn' => 'https://b1e259ce7e714dfeb49568c31ce99080@bugs.netsyms.net/10',
    'environment' => ($_SETTINGS["test"] ? "test" : "production"),
]);

if ($_SETTINGS["debug"]) {
    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
} else {
    error_reporting(0);
    ini_set('display_errors', 'off');
    ini_set('display_startup_errors', 'off');
    ini_set('html_errors', 'off');
}

$libs = glob(__DIR__ . "/lib/*.lib.php");
foreach ($libs as $lib) {
    require_once $lib;
}

$easypostClient = new \EasyPost\EasyPostClient($_SETTINGS["easypost_key"]);
$stripeClient = new \Stripe\StripeClient($_SETTINGS["stripe_sk"]);
\Stripe\Stripe::setApiKey($_SETTINGS["stripe_sk"]);

header("Access-Control-Allow-Origin: *");
