payment_name = "2Checkout"; $this->payment_site = "http://www.2checkout.com/"; $this->author_name = "Michael K. Squires"; $this->author_site = "http://www.burnwave.com/"; $this->checkout_options = 0; } function payment_config(){ global $prefix, $db; $result = $db->sql_query("SELECT * FROM ".$prefix."_cart_payments_options_2checkout"); $config = $db->sql_fetchrow($result); return $config; } function admin($function){ switch($function){ case "install": $this->admin_install(); break; case "options": $this->admin_options(); break; case "update": $this->admin_update(); break; case "uninstall": $this->admin_uninstall(); break; } } function admin_install() { global $prefix, $db; $db->sql_query("CREATE TABLE ".$prefix."_cart_payments_options_2checkout (sellerID int(11) NOT NULL default '0', tmode varchar(255) NOT NULL default '', ereceipt varchar(255) NOT NULL default '')"); $db->sql_query("INSERT INTO ".$prefix."_cart_payments_options_2checkout VALUES (12345, 'Y', 'FALSE')"); } function admin_options(){ global $prefix, $db, $admin_file; $tcheckout_config = $this->payment_config(); echo "
"; OpenTable(); echo "
" ."" ."payment_id."\">" ."" ."
"._EMPORIUM_ADMIN_PAYMENT_2CHECKOUT_OPTIONS."

" ."
" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."
"._EMPORIUM_ADMIN_PAYMENT_2CHECKOUT_SELLERID.":
"._EMPORIUM_ADMIN_PAYMENT_2CHECKOUT_TRANSMODE.":" ."
"._EMPORIUM_ADMIN_PAYMENT_2CHECKOUT_2CORECEIPT.":"; if ($tcheckout_config['ereceipt'] == "TRUE"){ $option_a = "checked"; $option_b = ""; } else { $option_a = ""; $option_b = "checked"; } echo ""._EMPORIUM_ADMIN_YES." " .""._EMPORIUM_ADMIN_NO.""; echo "

"; CloseTable(); } function admin_update() { global $prefix, $db, $sellerID, $tmode, $ereceipt, $admin_file; $db->sql_query("UPDATE ".$prefix."_cart_payments_options_2checkout SET sellerID='$sellerID', tmode='$tmode', ereceipt='$ereceipt'"); header("Location: ".$admin_file.".php?op=CartPaymentEdit&payment_id=".$this->payment_id.""); } function admin_uninstall() { global $prefix, $db; $db->sql_query("DROP TABLE ".$prefix."_cart_payments_options_2checkout"); } function payment($function){ switch($function){ case "receipt_display": $this->receipt_display(); break; } } function receipt_display(){ global $prefix, $db, $cartconfig; OpenTable(); echo "

"._EMPORIUM_MODULE_PAYMENT_2CHECKOUT_CLICKTO."
"; $payment_config = $this->payment_config(); $orderInfo = cartorderinfo($this->order_id); $grandTotal = sprintf("%01.2f", $orderInfo['GrandTotal']); if($orderInfo['billAddress2'] != ""){ $billAddress = $orderInfo['billAddress1'] . ", " . $orderInfo['billAddress2']; } else { $billAddress = $orderInfo['billAddress1']; } echo "\n\n

\n"; echo "\n"; echo "\n"; echo "order_id."\">\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "value("cartdomainProtocol")."".$cartconfig->value("cartdomainURL")."modules.php?name=Shopping_Cart&file=orders&c_op=viewReceipt&orderID=".$this->order_id."&code=".$orderInfo['code']."\">\n"; echo "\n"; echo "
\n\n"; CloseTable(); echo "
"; } } ?>