<?php
session_start();
require_once('../vendor/autoload.php');

if(file_exists(__DIR__ . '/../.env')) {
    $dotenv = Dotenv\Dotenv::createUnsafeImmutable(__DIR__ . '/../');
    $dotenv->load();
}

// if (!getenv('BT_ENVIRONMENT') || !getenv('BT_MERCHANT_ID') || !getenv('BT_PUBLIC_KEY') || !getenv('BT_PRIVATE_KEY')) {
//     throw new Exception('Cannot find necessary environmental variables. See https://github.com/braintree/braintree_php_example#setup-instructions for instructions');
// }

$gateway = new Braintree\Gateway([
    'environment' => 'production',
    'merchantId' => 'kpvhy3jdz3mqgdtz',
    'publicKey' => 'p79wz6scxf82jtsz',
    'privateKey' => '5f97e6bbbdb86694bab798b1fb5f806f'
]);
// $gateway = new Braintree\Gateway([
//     'environment' => 'sandbox',
//     'merchantId' => '63tmwpffhzsrbq38',
//     'publicKey' => 'rr6zkrbw2bbjydhw',
//     'privateKey' => '88c9c9ee180a6a6bd7d1eb8f6b5e6bb6'
// ]);
$baseUrl = stripslashes(dirname($_SERVER['SCRIPT_NAME']));
$baseUrl = $baseUrl == '/' ? $baseUrl : $baseUrl . '/';
