<commit_before><?php
/**
 * MOLPay OpenCart Plugin
 * 
 * @package Payment Gateway
 * @author MOLPay Technical Team <<EMAIL>>
 * @version 2.0
 */

class ControllerPaymentMolpay extends Controller {
	public function index() {
		$data['button_confirm'] = $this->language->get('button_confirm');

		$this->load->model('checkout/order');

		$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);

		$data['action'] = 'https://www.onlinepayment.com.my/MOLPay/pay/'.$this->config->get('molpay_mid').'/';
		$data['mid']= $this->config->get('molpay_mid');
		$data['amount'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);
		$data['orderid'] = $this->session->data['order_id'];
		$data['bill_name'] = $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname'];
		$data['bill_email'] = $order_info['email'];
		$data['bill_mobile'] = $order_info['telephone'];
		$data['country'] = $order_info['payment_iso_code_2'];
		$data['currency'] = $order_info['currency_code'];
		$data['vcode'] = md5($data['amount'].$this->config->get('molpay_mid').$data['orderid'].$this->config->get('molpay_vkey'));

		$products = $this->cart->getProducts();
            foreach ($products as $product) {
                $data['prod_desc'][]= $product['name']." x ".$product['quantity'];
            }
		
		$data['lang'] = $this->session->data['language'];

		$data['returnurl'] = $this->url->link('payment/molpay/return_ipn', '', 'SSL');

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/molpay.tpl')) {
			return $this->load->view($this->config->get('config_template') . '/template/payment/molpay.tpl', $data);<commit_msg>Load all channel into controller.<commit_after><?php
/**
 * MOLPay OpenCart Plugin
 * 
 * @package Payment Gateway
 * @author <NAME> <<EMAIL>>
 * @version 2.0
 */

class ControllerPaymentMolpay extends Controller {
	public function index() {
		$data['button_confirm'] = $this->language->get('button_confirm');

		$this->load->model('checkout/order');

		$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);

        if (isset($this->session->data['guest'])) 
        {
            $email = $this->session->data['guest']['email'];
            $telephone = $this->session->data['guest']['telephone'];
        }
        else
        {
            $email = $this->customer->getEmail();
            $telephone = $this->customer->getTelephone();
        }

		$data['action'] = 'https://www.onlinepayment.com.my/MOLPay/pay/'.$this->config->get('molpay_mid').'/';
		$data['mid']= $this->config->get('molpay_mid');
		$data['amount'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);
		$data['orderid'] = $this->session->data['order_id'];
		$data['bill_name'] = $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname'];
		$data['bill_email'] = $email;
		$data['bill_mobile'] = $telephone;
		$data['country'] = $order_info['payment_iso_code_2'];
		$data['currency'] = $order_info['currency_code'];
		$data['vcode'] = md5($data['amount'].$this->config->get('molpay_mid').$data['orderid'].$this->config->get('molpay_vkey'));

        //Load all channel from language file.
        $this->load->language('payment/molpay');
        $channel_list = $this->language->get('channel_list');

        foreach($channel_list as $key=>$val)
        {
            $inGet = 'molpay_'.$key.'_status';
            $data['channel_list'][$key] = $this->config->get($inGet);
        }

		$products = $this->cart->getProducts();
            foreach ($products as $product) {
                $data['prod_desc'][]= $product['name']." x ".$product['quantity'];
            }
		
		$data['lang'] = $this->session->data['language'];

		$data['returnurl'] = $this->url->link('payment/molpay/return_ipn', '', 'SSL');

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/molpay.tpl')) {
			return $this->load->view($this->config->get('config_template') . '/template/payment/molpay.tpl', $data);
{'fraction_non_alphanumeric': 0.22534872534872535, 'fraction_numerical': 0.001924001924001924, 'mean_word_length': 4.373385012919897, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 89, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1218225', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1348, 'n_words': 174}