예제 #1
0
 /**
  * Add merchant credentials to json.
  *
  * @param  string $json Json command.
  * @return string
  */
 protected function addMerchant($json)
 {
     $merchant = array('apiLogin' => $this->credentials->getApiLogin(), 'apiKey' => $this->credentials->getApiKey());
     $array = json_decode($json, true);
     $array['merchant'] = $merchant;
     return json_encode($array);
 }
 /**
  * @see MerchantCredentials::setApiLogin()
  */
 public function testSetApiLoginNewInstance()
 {
     $this->object = new MerchantCredentials();
     $apiLogin = '******' . rand(1, 1000);
     $rs = $this->object->setApiLogin($apiLogin);
     $this->assertInstanceOf('\\PayU\\Merchant\\MerchantCredentials', $rs);
     $rs = $this->object->getApiLogin();
     $this->assertInternalType('string', $rs);
     $this->assertEquals($apiLogin, $rs);
 }