* * Easyway Shop is a web e-commerce system */ class Computop_creditcardPaymentMethod { private $base_object; private $layout_object; private $customer_data; private $shipping_address; private $billing_address; private $shoppingcart; private $payment_method; private $shipping_method; private $gift_certificate; private $order_id; private $return_url; private $cancel_url; function __construct($base_object, $layout_object) { $this->base_object = $base_object; $this->layout_object = $layout_object; $this->customer_data = false; $this->shipping_address = false; $this->billing_address = false; $this->shoppingcart = false; $this->payment_method = false; $this->shipping_method = false; $this->gift_certificate = false; $this->order_id = false; $this->return_url = 'http://'.$_SERVER['SERVER_NAME'].'/Kasse/'; $this->cancel_url = $this->return_url.'&cancel=true'; } // end __construct public function set_data($customer, $shipping, $billing, $shoppingcart, $delivery, $payment, $order_id = false) { $this->customer_data = $customer; $this->shipping_address = $shipping; $this->billing_address = $billing; $this->shoppingcart = $shoppingcart; $this->payment_method = $delivery; $this->shipping_method = $payment; $this->order_id = $order_id; } // end set_data public function set_gift_certificate($gift_certificate) { $this->gift_certificate = $gift_certificate; } // end set_gift_certificate public function set_order_id($order_id) { $this->order_id = $order_id; } // end set_order_id public function before_order() { } // end before_order public function during_order() { } // end during_order public function after_order($order_total = false) { global $DEVMODE; if ($this->gift_certificate) { $order_total = $order_total - $this->gift_certificate->with_vat; } $order = new Order($this->base_object); $call = 'payment_open'; $this->layout_object->assign('call', $call); $merchantID = $this->base_object->config->shopConfiguration['computop_creditcard_merchant_id']; $this->layout_object->assign('merchantID', $merchantID); $trans_id = '10001'; $amount = intval($this->shoppingcart['order_total'] * 100); $currency = 'EUR'; $url_success = 'https://'.$_SERVER['SERVER_NAME'].'/creditcard_success/'; $url_failure = 'https://'.$_SERVER['SERVER_NAME'].'/creditcard_failed/'; $url_notify = 'https://'.$_SERVER['SERVER_NAME'].'/creditcard_failed/'; $order_desc = 'meine Bestellung'; $user_data = 'user'; $uri_string = "TransID=".$trans_id. "&Amount=".$amount. "&Currency=".$currency. "&OrderDesc=".$order_desc. "&UserData=".$user_data. "&URLSuccess=".$url_success. "&URLNotify=".$url_notify. "&URLFailure=".$url_failure; include_once './libs/ctPayGatePHP/includes/function.inc.php'; $BlowFish = new ctBlowfish; //$crypt_string = $BlowFish->ctEncrypt($uri_string, strlen($uri_string), $this->base_object->config->shopConfiguration['computop_creditcard_crypt_password']); $crypt_return = $BlowFish->ctEncrypt($uri_string, $this->base_object->config->shopConfiguration['computop_creditcard_crypt_password']); $crypt_string = $crypt_return['data']; $this->layout_object->assign('crypt_string', $crypt_string); $this->layout_object->assign('string_length', $crypt_return['len']); return $this->layout_object->_fetch('content_cash_desk/computop_creditcard.tpl'); } // end after_order public function change_order() { global $DEVMODE; } // end change_order } // end PaypalPaymentMethod /* EOF */