<commit_before><?php

/*
 * eCoin plugin for PHP merchant library
 *
 * @link      https://github.com/hiqdev/php-merchant-ecoin
 * @package   php-merchant-ecoin
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
 */

namespace hiqdev\php\merchant\ecoin;

class Merchant extends \hiqdev\php\merchant\Merchant
{
    protected static $_defaults = [
        'system'      => 'ecoin',
        'label'       => 'eCoin',
        'actionUrl'   => 'https://ecoin.cc/account/mpay/',
        'confirmText' => 'OK',
    ];

    public function getInputs()
    {
        return [
            'ECM_PURCH_DESC'  => $this->description,
            'ECM_INV_TITLE'   => $this->invTitle,
            'ECM_PAYEE_ID'    => $this->purse,
            'ECM_ITEM_COST'   => $this->total,
            'ECM_QTY'         => $this->quantity,
            'ECM_RESULT_URL'  => $this->confirmUrl,
            'ECM_SUCCESS_URL' => $this->successUrl,
            'ECM_FAIL_URL'    => $this->failureUrl,
        ];
    }

    public function getInvTitle()
    {
        return $this->username;
    }

    public function validateConfirmation($data)
    {
        $str = $data['ECM_TRANS_ID'] . $data['ECM_TRANS_DATE'] . $this->purse . $data['ECM_PAYER_ID'] . $data['ECM_ITEM_COST'] . $data['ECM_QTY'] . $this->secret;
        if (md5($str) !== strtolower($data['ECM_HASH'])) {
            return 'wrong hash';
        }
        $this->mset([
            'from' => $data['ECM_PAYER_ID'],
            'txn'  => $data['ECM_TRANS_ID'],
            'sum'  => $data['ECM_ITEM_COST'],
            'time' => date('c', strtotime($data['ECM_TRANS_DATE'])),
        ]);

        return;
    }
}<commit_msg>fixed '_secret' <- 'secret'<commit_after><?php

/*
 * eCoin plugin for PHP merchant library
 *
 * @link      https://github.com/hiqdev/php-merchant-ecoin
 * @package   php-merchant-ecoin
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
 */

namespace hiqdev\php\merchant\ecoin;

class Merchant extends \hiqdev\php\merchant\Merchant
{
    protected static $_defaults = [
        'system'      => 'ecoin',
        'label'       => 'eCoin',
        'actionUrl'   => 'https://ecoin.cc/account/mpay/',
        'confirmText' => 'OK',
    ];

    public function getInputs()
    {
        return [
            'ECM_PURCH_DESC'  => $this->description,
            'ECM_INV_TITLE'   => $this->invTitle,
            'ECM_PAYEE_ID'    => $this->purse,
            'ECM_ITEM_COST'   => $this->total,
            'ECM_QTY'         => $this->quantity,
            'ECM_RESULT_URL'  => $this->confirmUrl,
            'ECM_SUCCESS_URL' => $this->successUrl,
            'ECM_FAIL_URL'    => $this->failureUrl,
        ];
    }

    public function getInvTitle()
    {
        return $this->username;
    }

    public function validateConfirmation($data)
    {
        $str = $data['ECM_TRANS_ID'] . $data['ECM_TRANS_DATE'] . $this->purse . $data['ECM_PAYER_ID'] . $data['ECM_ITEM_COST'] . $data['ECM_QTY'] . $this->_secret;
        if (md5($str) !== strtolower($data['ECM_HASH'])) {
            return 'wrong hash';
        }
        $this->mset([
            'from' => $data['ECM_PAYER_ID'],
            'txn'  => $data['ECM_TRANS_ID'],
            'sum'  => $data['ECM_ITEM_COST'],
            'time' => date('c', strtotime($data['ECM_TRANS_DATE'])),
        ]);

        return;
    }
}
{'fraction_non_alphanumeric': 0.17228244945795487, 'fraction_numerical': 0.0035159683562847933, 'mean_word_length': 2.112123974475843, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 59, 'https://': 4, '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': '3989045', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1216, 'n_words': 180}