getSettings(); function curPageName() { return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); } if ( $settings['sandbox'] == 1) { $paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; $paypal_ipn_url = "https://ipnpb.sandbox.paypal.com/cgi-bin/webscr"; } else { $paypal_url = "https://www.paypal.com/cgi-bin/webscr"; $paypal_ipn_url = "https://ipnpb.paypal.com/cgi-bin/webscr"; } $s = ( isset($_SERVER['HTTPS']) and get_true_boolean($_SERVER['HTTPS']) ) ? "s" : ""; $port = isset($_SERVER['SERVER_PORT']) & $_SERVER['SERVER_PORT'] != "80" ? ":".$_SERVER['SERVER_PORT'] : NULL ; $this_script = 'http'.$s.'://'.$_SERVER['SERVER_NAME'].$port.$_SERVER['SCRIPT_NAME']; $current_folder_url = str_replace( curPageName(), "", $this_script); $cart_id = $_GET['cart_id']; $debug = $settings['debug']; if(!empty($cart_id)) { $orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)); //get couponID then discount for this cart $result= $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id)); foreach ($result as $cartDB){ $coupon_id = $cartDB['id']; } $coupon_discount = 0; $result = $db->resultQuery( "SELECT discount FROM ogp_billing_coupons WHERE id=".$db->realEscapeSingle($cartDB['coupon_id'])); foreach ($result as $couponDB){ $coupon_discount=$couponDB['discount']; } $coupon_discount = $coupon_discount / 100; if( !empty( $orders ) ) { $cart['price'] = 0; foreach($orders as $order) { if( $order['qty'] > 1 ) $order['invoice_duration'] = $order['invoice_duration']."s"; $cart['price'] += ($order['price']*$order['max_players']*$order['qty']); if( !isset( $cart['name'] ) ) $cart['name'] = $order['home_name']."(".$order['qty'].get_lang($order['invoice_duration']).",".$order['max_players'].get_lang('slots').")"; else $cart['name'] .= ' + '.$order['home_name']."(".$order['qty'].get_lang($order['invoice_duration']).",".$order['max_players'].get_lang('slots').")"; } //price minus coupon discount $cart['price'] = $cart['price'] - $cart['price']*$coupon_discount; $total = $cart['price']+($settings['tax_amount']/100*$cart['price']); if ($total === 0) { $db->query("UPDATE " . $table_prefix . "billing_carts SET paid=1 WHERE cart_id=".$db->realEscapeSingle($cart_id)); $view->refresh("home.php?m=billing&p=cart",0); } $total = number_format( $total , 2 ); } } // -- GENERATING THE PAYPAL ORDER BUTTON -- ?> onload="form1.submit()">

Debug Mode
Post Data being sent to Paypal

Sandbox Enabled = " .$settings['sandbox']; echo "
Paypal Url = " .$paypal_url; echo "
"; echo "
Paypal Email = ".$settings['paypal_email']; echo "
Item Name = ".$cart['name']; echo "
Item Number = ".$cart_id; echo "
Invoice ID = ".$cart_id; echo "
Amount = ".$total; echo "
Return Url = ". $current_folder_url."modules/billing/bounce.php"; echo "
Cancel Url = ". $this_script."?m=billing&p=cart"; echo "
Notify Url = ". $current_folder_url."modules/billing/ipn.php"; echo "
Currency Code =". $settings['currency']; echo "

"; echo ""; } echo "After payment, you must return to this site to CREATE YOUR SERVER
"; } ?>