Ejemplo n.º 1
0
 /**
  * @expectedException \Favor\Onfido\Exception\DuplicateApplicantCreationException
  */
 public function testCreateApplicantTwice()
 {
     $faker = Factory::create();
     $title = 'Mr';
     $first_name = $faker->firstName;
     $last_name = $faker->lastName;
     $middle_name = $faker->firstName;
     $email = $faker->email;
     $gender = 'Male';
     $dob = '1980-11-23';
     $telephone = '11234567890';
     $mobile = '10987654321';
     $country = 'usa';
     $params = array('title' => $title, 'first_name' => $first_name, 'last_name' => $last_name, 'middle_name' => $middle_name, 'email' => $email, 'gender' => $gender, 'dob' => $dob, 'telephone' => $telephone, 'mobile' => $mobile, 'country' => $country);
     $client = new RestClient(self::ONFIDO_TOKEN, false);
     $applicant = $client->createApplicant($params);
     $applicant2 = $client->createApplicant($params);
 }
Ejemplo n.º 2
0
 public function testRunIdentityCheck()
 {
     $faker = Factory::create();
     $first_name = $faker->firstName;
     $last_name = $faker->lastName;
     $params = array('first_name' => $first_name, 'last_name' => $last_name, 'dob' => $faker->date('Y-m-d'), 'email' => $faker->email, 'country' => 'USA', 'addresses' => array(array('building_number' => $faker->numberBetween(10, 10000), 'street' => $faker->streetName, 'town' => $faker->city, 'postcode' => 12345, 'country' => 'USA', 'state' => $faker->stateAbbr, 'start_date' => $faker->date('Y-m-d'))), 'id_numbers' => array(array('type' => 'ssn', 'value' => '433-54-3937')));
     $client = new RestClient(self::ONFIDO_TOKEN, false);
     $applicant = $client->createApplicant($params);
     $identityCheckReport = $client->runIdentityCheck($applicant->getId());
     $this->assertInstanceOf('Favor\\Onfido\\Report\\IdentityReport', $identityCheckReport);
 }