Ejemplo n.º 1
0
 /**
  * Make an successful call
  * Create a transaction then do the reserve call
  */
 public function testSuccessfulApiCall()
 {
     if (is_null($this->config)) {
         $this->markTestSkipped('Config is not set, please set up the required environment variables');
         return false;
     }
     $userId = "REGISTED:" . hash('md5', microtime());
     $billingRecipient = $this->faker->name;
     $shippingRecipient = $this->faker->name;
     $registerRequest = new RegisterUserRequest($this->config);
     $registerRequest->setUserID($userId)->setUserType(\Upg\Library\User\Type::USER_TYPE_PRIVATE)->setUserRiskClass(RiskClass::RISK_CLASS_DEFAULT)->setUserData($this->getUser())->setBillingAddress($this->getAddress())->setBillingRecipient($billingRecipient)->setShippingAddress($this->getAddress())->setShippingRecipient($shippingRecipient)->setLocale(Codes::LOCALE_EN);
     $registerUserApi = new RegisterUserApi($this->config, $registerRequest);
     $registerUserApi->sendRequest();
     $registerRequest->setUserRiskClass(RiskClass::RISK_CLASS_TRUSTED);
     $updateUserApi = new UpdateUserApi($this->config, $registerRequest);
     $result = $updateUserApi->sendRequest();
     $this->assertEquals(0, $result->getData('resultCode'));
     $this->assertEmpty($result->getData('message'));
     $this->assertNotEmpty($result->getData('salt'));
 }
Ejemplo n.º 2
0
 public function testGetUrl()
 {
     $request = new RegisterUser($this->config);
     $api = new UpdateUserApi($this->config, $request);
     $this->assertEquals('http://www.something.com/updateUser', $api->getUrl());
 }