function it_should_parse_only_two_letters_emp_endpoint()
 {
     \Genesis\Config::setEndpoint(\Genesis\API\Constants\Endpoints::EMERCHANTPAY);
     $this->setLanguage('en_US');
     $this->getApiConfig('url')->shouldContainString('wpf.emerchantpay.net:443/en/wpf');
     $this->setLanguage('zh_ZH');
     $this->getApiConfig('url')->shouldContainString('wpf.emerchantpay.net:443/zh/wpf');
 }
Example #2
0
 function it_can_connect_to_production_wpf()
 {
     $endpoints = array(\Genesis\API\Constants\Endpoints::ECOMPROCESSING, \Genesis\API\Constants\Endpoints::EMERCHANTPAY);
     Config::setEnvironment(\Genesis\API\Constants\Environments::PRODUCTION);
     foreach ($endpoints as $endpoint) {
         Config::setEndpoint($endpoint);
         $this->send_remote_connection(sprintf('https://%s%s', Config::getSubDomain('wpf'), Config::getEndpoint()));
     }
 }
 /**
  * Check whether Genesis is initialized and init if not
  *
  * @param string $model Name of the model, for which we query settings
  *
  * @return void
  */
 public function initClient($model)
 {
     $this->initLibrary();
     \Genesis\Config::setEndpoint('emerchantpay');
     \Genesis\Config::setUsername($this->getConfigData($model, 'genesis_username'));
     \Genesis\Config::setPassword($this->getConfigData($model, 'genesis_password'));
     \Genesis\Config::setEnvironment($this->getConfigData($model, 'genesis_environment'));
     \Genesis\Config::setToken($this->getConfigData($model, 'genesis_token') ? $this->getConfigData($model, 'genesis_token') : '');
 }
 /**
  * Set the the Credentials and Environment to the Gateway Client
  * @return void
  * @throws \Genesis\Exceptions\InvalidArgument
  */
 public function initGatewayClient()
 {
     \Genesis\Config::setEndpoint(\Genesis\API\Constants\Endpoints::EMERCHANTPAY);
     \Genesis\Config::setUsername($this->getUserName());
     \Genesis\Config::setPassword($this->getPassword());
     $token = $this->getToken();
     if (!empty($token)) {
         \Genesis\Config::setToken($token);
     }
     \Genesis\Config::setEnvironment($this->getIsStagingMode() ? \Genesis\API\Constants\Environments::STAGING : \Genesis\API\Constants\Environments::PRODUCTION);
 }
 function it_should_build_correct_url_for_emp_endpoint()
 {
     \Genesis\Config::setEndpoint(\Genesis\API\Constants\Endpoints::EMERCHANTPAY);
     $this->getApiConfig('url')->shouldBe('https://staging.gate.emerchantpay.net:443/retrieve_abn_ideal_banks');
 }
 function it_should_have_default_environment_url_for_emp_endpoint()
 {
     \Genesis\Config::setEndpoint(\Genesis\API\Constants\Endpoints::EMERCHANTPAY);
     $this->getApiConfig('url')->shouldBe('https://staging.gate.emerchantpay.net:443/blacklists');
 }