/** * 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::setApiKey() */ public function testSetApiKeyNewInstance() { $this->object = new MerchantCredentials(); $apiKey = 'apiKey_' . rand(1, 1000); $rs = $this->object->setApiKey($apiKey); $this->assertInstanceOf('\\PayU\\Merchant\\MerchantCredentials', $rs); $rs = $this->object->getApiKey(); $this->assertInternalType('string', $rs); $this->assertEquals($apiKey, $rs); }