<commit_before><?php

class Merchants extends Module
{
    public $current = '';

    function init()
    {
        if (!empty($this->config['default'])) {
            $this->current = $this->config['default'];
        }
    }

    function getPayUrl($pay, $merchant, $merchantOptions)
    {
        if ($merchant) {
            $objectName = $merchant->object_name;
        } else {
            $objectName = $this->current;
        }
        if (is_array($pay)) {
            $pay = new Merchants\Pay($pay);
            $pay->save();
        }

        $className = 'Merchants\MerchantHelper\\' . $objectName;
        return $className::getPayUrl($pay->id, $pay->sum, $merchantOptions['description'], $merchantOptions['success'], $merchantOptions['false']);
    }

    function reciver($data, $system, $status, $mr)
    {
        if ($system) {
            $merchant = \Merchants\Merchant::get($system, 'object_name');
        } else {
            $merchant = false;
        }
        if ($merchant) {
            $this->current = $system;
        }
        $className = 'Merchants\MerchantHelper\\' . $this->current;
        $result = $className::reciver($data, $status);
        $result['pay'] = null;
        if (!empty($result['payId'])) {
            $result['pay'] = Merchants\Pay::get($result['payId']);
        }
        if ($result['pay'] && $result['pay']->callback_module && $result['pay']->callback_method) {
            $status = $this->{$result['pay']->callback_module}->{$result['pay']->callback_method}($result);
        }
        if (isset($status) && $result['pay']) {
            $result['pay']->pay_status_id = $status;
            //TODO
            //$result['pay']->date_recive = date('Y-m-d H:i:s');
            $result['pay']->save();
        }
        if (!empty($result['payId'])) {
            $mr->pay_id = $result['payId'];
        }
        if (!empty($result['callback'])) {<commit_msg>call fix<commit_after><?php

class Merchants extends Module
{
    public $current = '';

    function init()
    {
        if (!empty($this->config['default'])) {
            $this->current = $this->config['default'];
        }
    }

    function getPayUrl($pay, $merchant, $merchantOptions)
    {
        if ($merchant) {
            $objectName = $merchant->object_name;
        } else {
            $objectName = $this->current;
        }
        if (is_array($pay)) {
            $pay = new Merchants\Pay($pay);
            $pay->save();
        }

        $className = 'Merchants\MerchantHelper\\' . $objectName;
        return $className::getPayUrl($pay->id, $pay->sum, $merchantOptions['description'], $merchantOptions['success'], $merchantOptions['false']);
    }

    function reciver($data, $system, $status, $mr)
    {
        if ($system) {
            $merchant = \Merchants\Merchant::get($system, 'object_name');
        } else {
            $merchant = false;
        }
        if ($merchant) {
            $this->current = $system;
        }
        $className = 'Merchants\MerchantHelper\\' . $this->current;
        $result = $className::reciver($data, $status);
        $result['pay'] = null;
        if (!empty($result['payId'])) {
            $result['pay'] = Merchants\Pay::get($result['payId']);
        }
        if ($result['pay'] && $result['pay']->callback_module && $result['pay']->callback_method) {
            $status = App::$cur->{$result['pay']->callback_module}->{$result['pay']->callback_method}($result);
        }
        if (isset($status) && $result['pay']) {
            $result['pay']->pay_status_id = $status;
            //TODO
            //$result['pay']->date_recive = date('Y-m-d H:i:s');
            $result['pay']->save();
        }
        if (!empty($result['payId'])) {
            $mr->pay_id = $result['payId'];
        }
        if (!empty($result['callback'])) {
{'fraction_non_alphanumeric': 0.19692628288616829, 'fraction_numerical': 0.0, 'mean_word_length': 2.1527093596059115, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '2218929', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1165, 'n_words': 181}