sessioncheck(); $shop = new Shop; $shopconf = $shop->json->load_json("../../server/config/paypal.json"); if(strtolower($_SERVER['REQUEST_METHOD']) != 'post') { $messages->message('Checkout page cannot be accessed this way.'); $messages->showmessage(); exit; } if(!empty($_GET)) { $messages->message('Checkout page cannot be accessed this way.'); $messages->showmessage(); exit; } if(empty($_SESSION)) { $messages->message('Checkout page cannot be accessed this way.'); $messages->showmessage(); exit; } if(!isset($_SESSION['token'])) { $messages->message('Token is not set.'); $messages->showmessage(); exit; } if(!isset($_SESSION['cartid'])) { $messages->message('Cart ID is not set.'); $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-gateway'])) { $messages->message('Gateway page could not be loaded from resource and cannot be accessed this way.'); $messages->showmessage(); exit; } $cartid = $sanitizer->sanitize($_SESSION['cartid'],'alphanum'); $productsum_total = (int) $_SESSION['subtotal']; $country_price = (int) $_SESSION['shipping']; $total_price = (int) $_SESSION['totalprice']; $shipping_country = (int) $_SESSION['shipping_country']; $tax = $_SESSION['tax']; $idtax = false; $dir = '../../server/config/orders.conf.json'; $invoiceid = $invoicer->invoiceid($dir,'get'); if($invoiceid > 0) { $invoiceid = ($invoiceid +1); $_SESSION['invoiceid'] = $invoiceid; } else { $invoiceid = 1; $_SESSION['invoiceid'] = $invoiceid; } // echo $_SESSION['invoiceid']; /* No need to edit this below. * Start of PayPal code */ // Price of the product. $item_price = $productsum_total; // Handling price. $handling_price = 0; // Shipping price. $shipping_price = $country_price; // PayPal variables: only edit this in paypal.json! $paypal_domain = $sanitizer->cleaninput($shopconf[0]['paypal.domain']); $paypal_cancel_page = $sanitizer->cleaninput($shopconf[0]['paypal.cancel.page']); $paypal_return_page = $sanitizer->cleaninput($shopconf[0]['paypal.return.page']); $paypal_email = $sanitizer->cleaninput($shopconf[0]['paypal.email']); $paypal_notify_url = $sanitizer->cleaninput($shopconf[0]['paypal.notify.url']); $paypal_currency_code = $sanitizer->cleaninput($shopconf[0]['paypal.currency.code']); $paypal_invoice_number = $invoiceid; if(empty($paypal_invoice_number)) { // should not be empty. $paypal_invoice_number = 1; } $paypal_image_url = $sanitizer->cleaninput($shopconf[0]['paypal.image.url']); if(empty($paypal_image_url)) { $paypal_image_url = 'http://www.paypal.com/en_US/i/btn/x-click-but01.gif'; } $paypal_no_note = $sanitizer->cleaninput($shopconf[0]['paypal.no.note']); $paypal_no_shipping = $sanitizer->cleaninput($shopconf[0]['paypal.no.shipping']); $paypal_on0 = $sanitizer->cleaninput($shopconf[0]['paypal.on0']); $paypal_on1 = $sanitizer->cleaninput($shopconf[0]['paypal.on1']); $paypal_os0 = $sanitizer->cleaninput($shopconf[0]['paypal.os0']); $paypal_os1 = $sanitizer->cleaninput($shopconf[0]['paypal.os1']); $paypal_show_user_details = $sanitizer->cleaninput($shopconf[0]['paypal.show.user.details']); $paypal_store_user_details = $sanitizer->cleaninput($shopconf[0]['paypal.store.user.details']); /* * doc: https://developer.paypal.com/docs/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/#individual-items-variables */ ?>
getmeta("../../server/config/site.conf.json"); ?>