payment_name = "WorldPay"; $this->payment_site = "http://www.worldpay.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_worldpay"); $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_worldpay (vendorID varchar(255) NOT NULL default '', pmode char(3) NOT NULL default '')"); $db->sql_query("INSERT INTO ".$prefix."_cart_payments_options_worldpay VALUES ('vendorID', '0')"); } function admin_options(){ global $prefix, $db, $admin_file; $worldpay_config = $this->payment_config(); echo "
"; OpenTable(); echo "
" ."" ."payment_id."\">" ."" ."
"._EMPORIUM_ADMIN_PAYMENT_WORLDPAY_OPTIONS."

" ."
" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."
"._EMPORIUM_ADMIN_PAYMENT_WORLDPAY_VENDORID.":
"._EMPORIUM_ADMIN_PAYMENT_WORLDPAY_PROCESSMODE.":" ."

"; CloseTable(); } function admin_update() { global $prefix, $db, $xvendorID, $xpmode, $admin_file; $db->sql_query("UPDATE ".$prefix."_cart_payments_options_worldpay SET vendorID='$xvendorID', pmode='$xpmode'"); 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_worldpay"); } function payment($function){ switch($function){ case "receipt_display": $this->receipt_display(); break; } } function receipt_display(){ global $prefix, $db, $cartconfig; $payment_config = $this->payment_config(); $orderInfo = cartorderinfo($this->order_id); $desc = "".$cartconfig->value("companyName")." --- "._EMPORIUM_MODULE_PAYMENT_WORLDPAY_ORDER." #".$this->order_id.""; $grandTotal = sprintf("%01.2f", $orderInfo['GrandTotal']); OpenTable(); echo "

"._EMPORIUM_MODULE_PAYMENT_WORLDPAY_CLICKTO."
"; echo "\n\n

\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 "
\n\n"; CloseTable(); echo "
"; } } ?>