<commit_before><?php

namespace Omnipay\JDPay;

use Omnipay\Common\AbstractGateway;

/**
 * Class BaseAbstractGateway
 * @package Omnipay\JDPay
 * @method \Omnipay\Common\Message\RequestInterface authorize(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface completeAuthorize(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface capture(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface void(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface createCard(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface updateCard(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface deleteCard(array $options = array())
 */

abstract class BaseAbstractGateway extends AbstractGateway
{
    abstract public function getVersion();
    abstract public function getTradeType();

    /**
     * @param array $parameters
     * @return \Omnipay\JDPay\Message\PurchaseRequest
     */
    public function purchase(array $parameters = array())
    {
        $parameters['trade_type'] = $this->getTradeType();
        $parameters['version'] = $this->getVersion();
        return $this->createRequest('\Omnipay\JDPay\Message\PurchaseRequest', $parameters);
    }

    public function completePurchase(array $parameters = array ())
    {
        return null;
    }

    public function notify($parameters = array ())
    {
        return null;
    }

    public function query($parameters = array ())
    {
        return null;
    }

    public function refund(array $parameters = array ())
    {
        return null;
    }
}<commit_msg>fix DES parameter<commit_after><?php

namespace Omnipay\JDPay;

use Omnipay\Common\AbstractGateway;

/**
 * Class BaseAbstractGateway
 * @package Omnipay\JDPay
 * @method \Omnipay\Common\Message\RequestInterface authorize(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface completeAuthorize(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface capture(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface void(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface createCard(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface updateCard(array $options = array())
 * @method \Omnipay\Common\Message\RequestInterface deleteCard(array $options = array())
 */

abstract class BaseAbstractGateway extends AbstractGateway
{
    abstract public function getVersion();
    abstract public function getTradeType();

    // Fix integer parameter DES failed
    protected function wrapperParameters($parameters)
    {
        return array_map(function ($v) {
            return (string)$v;
        }, $parameters);
    }

    /**
     * @param array $parameters
     * @return \Omnipay\JDPay\Message\PurchaseRequest
     */
    public function purchase(array $parameters = array())
    {
        $parameters['trade_type'] = $this->getTradeType();
        $parameters['version'] = $this->getVersion();
        return $this->createRequest('\Omnipay\JDPay\Message\PurchaseRequest', $this->wrapperParameters($parameters));
    }

    public function completePurchase(array $parameters = array ())
    {
        return null;
    }

    public function notify($parameters = array ())
    {
        return null;
    }

    public function query($parameters = array ())
    {
        return null;
    }

    public function refund(array $parameters = array ())
    {
        return null;
    }
}
{'fraction_non_alphanumeric': 0.12311135982092893, 'fraction_numerical': 0.0, 'mean_word_length': 3.606958762886598, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '239834', 'n_tokens_mistral': 1006, 'n_tokens_neox': 1001, 'n_words': 216}