<commit_before><?php

namespace Locastic\TcomPayWay\AuthorizeDirect\Helpers;

use Locastic\TcomPayWay\AuthorizeDirect\Model\Payment;

/**
 * Used for generating signature for payment request
 *
 * Class SignatureGenerator
 * @package Locastic\TcomPayWay\AuthorizeForm\Helpers
 */
class SignatureGenerator
{
    const METHOD_NAME = 'authorize-direct';

    /**
     * Based on payment model generates signature
     *
     * @param string $secretKey
     * @param Payment $payment
     *
     * @return string
     */
    public static function getSignature($secretKey, Payment $payment)
    {
        $string = self::METHOD_NAME.$secretKey;

        $string .= $payment->getPgwShopId().$secretKey;
        $string .= $payment->getPgwOrderId().$secretKey;
        $string .= $payment->getPgwAmount().$secretKey;
        $string .= $payment->getPgwInstallments().$secretKey;
        $string .= $payment->getPgwAuthorizationType().$secretKey;
        $string .= $payment->getPgwAuthorizationToken().$secretKey;
        $string .= $payment->getPgwLanguage().$secretKey;
        $string .= $payment->getPgwReturnMethod().$secretKey;
        $string .= $payment->getPgwSuccessUrl().$secretKey;
        $string .= $payment->getPgwFailureUrl().$secretKey;
        $string .= $payment->getPgwCardNumber().$secretKey;
        $string .= $payment->getPgwCardExpirationDate().$secretKey;
        $string .= $payment->getPgwCardVerificationData().$secretKey;
        $string .= $payment->getPgwFirstName().$secretKey;
        $string .= $payment->getPgwLastName().$secretKey;
        $string .= $payment->getPgwStreet().$secretKey;
        $string .= $payment->getPgwCity().$secretKey;
        $string .= $payment->getPgwPostCode().$secretKey;
        $string .= $payment->getPgwCountry().$secretKey;
        $string .= $payment->getPgwPhoneNumber().$secretKey;
        $string .= $payment->getPgwEmail().$secretKey;

        $string .= $payment->getPgwMerchantData().$secretKey;

        return hash('sha512', $string);
    }
}<commit_msg>Test for generating signatures updated<commit_after><?php

namespace Locastic\TcomPayWay\AuthorizeDirect\Helpers;

use Locastic\TcomPayWay\AuthorizeDirect\Model\Payment;

/**
 * Used for generating signature for payment request
 *
 * Class SignatureGenerator
 * @package Locastic\TcomPayWay\AuthorizeForm\Helpers
 */
class SignatureGenerator
{
    const METHOD_NAME = 'authorize-direct';

    /**
     * Based on payment model generates signature
     *
     * @param string  $secretKey
     * @param Payment $payment
     *
     * @return string
     */
    public static function getSignature($secretKey, Payment $payment)
    {
        $string = self::METHOD_NAME.$secretKey;

        $string .= $payment->getPgwShopId().$secretKey;
        $string .= $payment->getPgwOrderId().$secretKey;
        $string .= $payment->getPgwAmount().$secretKey;
        $string .= $payment->getPgwInstallments().$secretKey;
        $string .= $payment->getPgwAuthorizationType().$secretKey;
        $string .= $payment->getPgwAuthorizationToken().$secretKey;
        $string .= $payment->getPgwLanguage().$secretKey;
        $string .= $payment->getPgwReturnMethod().$secretKey;
        $string .= $payment->getPgwSuccessUrl().$secretKey;
        $string .= $payment->getPgwFailureUrl().$secretKey;
        $string .= $payment->getPgwCardNumber().$secretKey;
        $string .= $payment->getPgwCardExpirationDate().$secretKey;
        $string .= $payment->getPgwCardVerificationData().$secretKey;
        $string .= $payment->getPgwFirstName().$secretKey;
        $string .= $payment->getPgwLastName().$secretKey;
        $string .= $payment->getPgwStreet().$secretKey;
        $string .= $payment->getPgwCity().$secretKey;
        $string .= $payment->getPgwPostCode().$secretKey;
        $string .= $payment->getPgwCountry().$secretKey;
        $string .= $payment->getPgwPhoneNumber().$secretKey;
        $string .= $payment->getPgwEmail().$secretKey;
        $string .= $payment->getPgwMerchantData().$secretKey;

        return hash('sha512', $string);
    }
}
{'fraction_non_alphanumeric': 0.15346898749693552, 'fraction_numerical': 0.0014709487619514587, 'mean_word_length': 3.299262381454162, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, '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': '7488815', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1236, 'n_words': 184}