<commit_before><?php
class ControllerPaymentInstamojo extends Controller {

  private $logger;

  public function __construct($arg)
  {
    $this->logger= new Log('imojo.log');
    parent::__construct($arg);
  }

  public function index() {

    $this->language->load('payment/instamojo');
    $method_data['button_confirm'] = $this->language->get('button_confirm');
    $method_data['action'] = $this->config->get('instamojo_payment_link');
  
    $this->load->model('checkout/order');
    $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
  
    if ($order_info) {
      $api_key = $this->config->get('instamojo_api_key');
      $auth_token = $this->config->get('instamojo_auth_token');
      $private_salt = $this->config->get('instamojo_private_salt');
      $custom_field_name = 'data_' . $this->config->get('instamojo_custom_field');

      $this->logger->write("$api_key | $auth_token | $private_salt | $custom_field_name");

      $name = substr(trim((html_entity_decode($order_info['shipping_firstname'] . ' ' . $order_info['shipping_lastname'], ENT_QUOTES, 'UTF-8'))), 0, 20);
      $email = substr($order_info['email'], 0, 75);
      $phone = substr(html_entity_decode($order_info['telephone'], ENT_QUOTES, 'UTF-8'), 0, 20);
      $amount = $this->currency->format($order_info['total'], $order_info['currency_code'] , false, false);
      $orderid = date('His') . '-' . $this->session->data['order_id'];

      $this->logger->write("$name | $email | $phone | $amount | $orderid");

      $data = Array();
      $data['data_name'] = $name;
      $data['data_email'] = $email;
      $data['data_amount'] = $amount;
      $data['data_phone'] = $phone;
      $data[$custom_field_name] = $orderid;

      $this->logger->write("Data before sorting: " .  print_r($data, true));

      $ver = explode('.', phpversion());
      $major = (int) $ver[0];
      $minor = (int) $ver[1];

      if($major >= 5 and $minor >= 4){<commit_msg>Replaced `shipping_firstname` and `shipping_lastname` with `payment_firstname` and `shipping_lastname` respectively<commit_after><?php
class ControllerPaymentInstamojo extends Controller {

  private $logger;

  public function __construct($arg)
  {
    $this->logger= new Log('imojo.log');
    parent::__construct($arg);
  }

  public function index() {

    $this->language->load('payment/instamojo');
    $method_data['button_confirm'] = $this->language->get('button_confirm');
    $method_data['action'] = $this->config->get('instamojo_payment_link');
  
    $this->load->model('checkout/order');
    $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
  
    if ($order_info) {
      $api_key = $this->config->get('instamojo_api_key');
      $auth_token = $this->config->get('instamojo_auth_token');
      $private_salt = $this->config->get('instamojo_private_salt');
      $custom_field_name = 'data_' . $this->config->get('instamojo_custom_field');

      $this->logger->write("$api_key | $auth_token | $private_salt | $custom_field_name");

      $name = substr(trim((html_entity_decode($order_info['payment_firstname'] . ' ' . $order_info['payment_lastname'], ENT_QUOTES, 'UTF-8'))), 0, 20);
      $email = substr($order_info['email'], 0, 75);
      $phone = substr(html_entity_decode($order_info['telephone'], ENT_QUOTES, 'UTF-8'), 0, 20);
      $amount = $this->currency->format($order_info['total'], $order_info['currency_code'] , false, false);
      $orderid = date('His') . '-' . $this->session->data['order_id'];

      $this->logger->write("$name | $email | $phone | $amount | $orderid");

      $data = Array();
      $data['data_name'] = $name;
      $data['data_email'] = $email;
      $data['data_amount'] = $amount;
      $data['data_phone'] = $phone;
      $data[$custom_field_name] = $orderid;

      $this->logger->write("Data before sorting: " .  print_r($data, true));

      $ver = explode('.', phpversion());
      $major = (int) $ver[0];
      $minor = (int) $ver[1];

      if($major >= 5 and $minor >= 4){
{'fraction_non_alphanumeric': 0.19930761622156282, 'fraction_numerical': 0.00741839762611276, 'mean_word_length': 4.232858990944373, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4816136', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1348, 'n_words': 209}