<commit_before><?php namespace Philipbrown\Worldpay;

use Carbon\Carbon;
use Symfony\Component\HttpFoundation\RedirectResponse as HttpRedirectResponse;
use Philipbrown\Worldpay\Exceptions\InvalidRequestException as InvalidRequestException;

class Request extends AbstractWorldpay {

  /**
   * @var array
   */
  protected $endpoints = array(
    'production'  => 'https://secure.worldpay.com/wcc/purchase',
    'development' => 'https://secure-test.worldpay.com/wcc/purchase'
  );

  /**
   * @var array
   */
  protected $config;

  /**
   * @var string
   */
  protected $secret;

  /**
   * @var array
   */
  protected $fields;

  /**
   * Construct
   *
   * @var array $config
   * @var array $parameters
   * @return void
   */
  public function __construct($config, $parameters)
  {
    parent::__construct();

    $this->config = $config;

    $this->initialise($parameters);

    $this->setEnvironmentParameter(($config['env']) ? $config['env'] : 'development');
  }

  /**
   * Set Secret
   *<commit_msg>Clean up setting the environment<commit_after><?php namespace Philipbrown\Worldpay;

use Carbon\Carbon;
use Symfony\Component\HttpFoundation\RedirectResponse as HttpRedirectResponse;
use Philipbrown\Worldpay\Exceptions\InvalidRequestException as InvalidRequestException;

class Request extends AbstractWorldpay {

  /**
   * @var array
   */
  protected $endpoints = array(
    'production'  => 'https://secure.worldpay.com/wcc/purchase',
    'development' => 'https://secure-test.worldpay.com/wcc/purchase'
  );

  /**
   * @var array
   */
  protected $config;

  /**
   * @var string
   */
  protected $secret;

  /**
   * @var array
   */
  protected $fields;

  /**
   * Construct
   *
   * @var array $config
   * @var array $parameters
   * @return void
   */
  public function __construct($config, $parameters)
  {
    parent::__construct();

    $this->config = $config;

    $this->initialise($parameters);

    $this->setEnvironmentParameter($config['env']);
  }

  /**
   * Set Secret
   *
{'fraction_non_alphanumeric': 0.14519326065411298, 'fraction_numerical': 0.0, 'mean_word_length': 3.2327044025157234, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5269515', 'n_tokens_mistral': 639, 'n_tokens_neox': 615, 'n_words': 122}