language->get('button_confirm'); $this->load->model('checkout/order'); $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']); $data['action'] = 'https://liqpay.com/?do=clickNbuy'; $xml = ''; $xml .= ' 1.2'; $xml .= ' ' . $this->url->link('checkout/success', '', true) . ''; $xml .= ' ' . $this->url->link('extension/payment/liqpay/callback', '', true) . ''; $xml .= ' ' . $this->config->get('payment_liqpay_merchant') . ''; $xml .= ' ' . $this->session->data['order_id'] . ''; $xml .= ' ' . $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false) . ''; $xml .= ' ' . $order_info['currency_code'] . ''; $xml .= ' ' . $this->config->get('config_name') . ' ' . $order_info['payment_firstname'] . ' ' . $order_info['payment_address_1'] . ' ' . $order_info['payment_address_2'] . ' ' . $order_info['payment_city'] . ' ' . $order_info['email'] . ''; $xml .= ' '; $xml .= ' ' . $this->config->get('payment_liqpay_type') . ''; $xml .= ''; $data['xml'] = base64_encode($xml); $data['signature'] = base64_encode(sha1($this->config->get('payment_liqpay_signature') . $xml . $this->config->get('payment_liqpay_signature'), true)); return $this->load->view('extension/payment/liqpay', $data); } public function callback() { $xml = base64_decode($this->request->post['operation_xml']); $signature = base64_encode(sha1($this->config->get('payment_liqpay_signature') . $xml . $this->config->get('payment_liqpay_signature'), true)); $posleft = strpos($xml, 'order_id'); $posright = strpos($xml, '/order_id'); $order_id = substr($xml, $posleft + 9, $posright - $posleft - 10); if ($signature == $this->request->post['signature']) { $this->load->model('checkout/order'); $this->model_checkout_order->addOrderHistory($order_id, $this->config->get('config_order_status_id')); } } }