sessioncheck(); $addedvalue = false; if(!empty($_GET)) { $messages->message('Checkout page cannot be accessed this way.'); $messages->showmessage(); exit; } if(isset($_SESSION['token'])) { $token = $_SESSION['token']; if($token != $_POST['token']) { $messages->message('Token is incorrect.'); $messages->showmessage(); exit; } } else { $messages->message('Token is incorrect or not set.'); $messages->showmessage(); exit; } if(!isset($_POST['checkout-post'])) { $messages->message('Checkout page could not be loaded from resource and cannot be accessed this way.'); $messages->showmessage(); exit; } /* Get the currency of site.json * To change the default currency, edit site.json which has a numeric value that corresponds to the values inside currencies.json. * DO NOT edit currencies.json, unless adding a new currency, as this file is used throughout OpenShop and might break functionality. */ $sitecurrency = $shop->getsitecurrency('../server/config/site.conf.json','../server/config/currencies.conf.json'); // echo $shop->debug($_POST); if(isset($_POST['payment_gateway'])) { $payment_gateway = $sanitizer->sanitize($_POST['payment_gateway'],'encode'); } else { $payment_gateway = 'PayPal'; $messages->message('Payment Gateway not selected, assuming and defaulting to PayPal'); $messages->showmessage(); } if(isset($_POST['shipping_country'])) { $shippingcountry = $sanitizer->sanitize($_POST['shipping_country'],'encode'); } else { $messages->message('Country not selected, cannot continue to checkout!'); $messages->showmessage(); exit; } if(isset($_POST['cooffset'])) { $addedvalue = true; $carbonvalue = (float)$_POST['cooffset']; $_SESSION['carbonoffset'] = $carbonvalue; } $gateway = $sanitizer->sanitize($payment_gateway,'alphanum'); ?>
getmeta(); ?>