<commit_before><?php

/*
 * This file is part of the Omnipay package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Omnipay\SecurePay\Message;

/**
 * SecurePay Direct Post Authorize Request
 */
class DirectPostAuthorizeRequest extends DirectPostAbstractRequest
{
    public $txnType = '1';

    public function getData()
    {
        $this->validate('amount', 'returnUrl');

        $data = array();
        $data['EPS_MERCHANT'] = $this->getMerchantId();
        $data['EPS_TXNTYPE'] = $this->txnType;
        $data['EPS_IP'] = $this->getClientIp();
        $data['EPS_AMOUNT'] = $this->getAmountDecimal();
        $data['EPS_REFERENCEID'] = $this->getTransactionId();
        $data['EPS_TIMESTAMP'] = gmdate('YmdHis');
        $data['EPS_FINGERPRINT'] = $this->generateFingerprint($data);
        $data['EPS_RESULTURL'] = $this->getReturnUrl();
        $data['EPS_CURRENCY'] = $this->getCurrency();

        return $data;
    }

    public function generateFingerprint(array $data)
    {<commit_msg>Add SecurePay callback URL<commit_after><?php

/*
 * This file is part of the Omnipay package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Omnipay\SecurePay\Message;

/**
 * SecurePay Direct Post Authorize Request
 */
class DirectPostAuthorizeRequest extends DirectPostAbstractRequest
{
    public $txnType = '1';

    public function getData()
    {
        $this->validate('amount', 'returnUrl');

        $data = array();
        $data['EPS_MERCHANT'] = $this->getMerchantId();
        $data['EPS_TXNTYPE'] = $this->txnType;
        $data['EPS_IP'] = $this->getClientIp();
        $data['EPS_AMOUNT'] = $this->getAmountDecimal();
        $data['EPS_REFERENCEID'] = $this->getTransactionId();
        $data['EPS_TIMESTAMP'] = gmdate('YmdHis');
        $data['EPS_FINGERPRINT'] = $this->generateFingerprint($data);
        $data['EPS_RESULTURL'] = $this->getReturnUrl();
        $data['EPS_CALLBACKURL'] = $this->getReturnUrl();
        $data['EPS_REDIRECT'] = 'TRUE';
        $data['EPS_CURRENCY'] = $this->getCurrency();

        return $data;
    }

    public function generateFingerprint(array $data)
    {
{'fraction_non_alphanumeric': 0.15491768678767412, 'fraction_numerical': 0.0008442380751371887, 'mean_word_length': 3.4299065420560746, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 28, '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': '3832974', 'n_tokens_mistral': 771, 'n_tokens_neox': 762, 'n_words': 159}