| @@ 54-64 (lines=11) @@ | ||
| 51 | * @param string $number Number of Identification Card |
|
| 52 | * @return string|null |
|
| 53 | */ |
|
| 54 | public function validatePersonalIdentification($number) |
|
| 55 | { |
|
| 56 | $identification = new PersonalIdentification(); |
|
| 57 | ||
| 58 | try { |
|
| 59 | return $identification->validate($number); |
|
| 60 | } catch (EcuadorIdentificationException $e) { |
|
| 61 | $this->setError($e->getMessage()); |
|
| 62 | return null; |
|
| 63 | } |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * Validates the Ecuadorian RUC of Natural Person |
|
| @@ 72-82 (lines=11) @@ | ||
| 69 | * @param string $number Number of RUC Natural Person |
|
| 70 | * @return string|null |
|
| 71 | */ |
|
| 72 | public function validateNaturalPersonRuc($number) |
|
| 73 | { |
|
| 74 | $identification = new NaturalRuc(); |
|
| 75 | ||
| 76 | try { |
|
| 77 | return $identification->validate($number); |
|
| 78 | } catch (EcuadorIdentificationException $e) { |
|
| 79 | $this->setError($e->getMessage()); |
|
| 80 | return null; |
|
| 81 | } |
|
| 82 | } |
|
| 83 | ||
| 84 | /** |
|
| 85 | * Validates the Ecuadorian RUC of Private Companies |
|
| @@ 90-100 (lines=11) @@ | ||
| 87 | * @param string $number Number of RUC Private Companies |
|
| 88 | * @return string|null |
|
| 89 | */ |
|
| 90 | public function validatePrivateCompanyRuc($number) |
|
| 91 | { |
|
| 92 | $identification = new PrivateRuc(); |
|
| 93 | ||
| 94 | try { |
|
| 95 | return $identification->validate($number); |
|
| 96 | } catch (EcuadorIdentificationException $e) { |
|
| 97 | $this->setError($e->getMessage()); |
|
| 98 | return null; |
|
| 99 | } |
|
| 100 | } |
|
| 101 | ||
| 102 | /** |
|
| 103 | * Validates the Ecuadorian RUC of Public Companies |
|
| @@ 108-118 (lines=11) @@ | ||
| 105 | * @param string $number Number of RUC Public Companies |
|
| 106 | * @return string|null |
|
| 107 | */ |
|
| 108 | public function validatePublicCompanyRuc($number) |
|
| 109 | { |
|
| 110 | $identification = new PublicRuc(); |
|
| 111 | ||
| 112 | try { |
|
| 113 | return $identification->validate($number); |
|
| 114 | } catch (EcuadorIdentificationException $e) { |
|
| 115 | $this->setError($e->getMessage()); |
|
| 116 | return null; |
|
| 117 | } |
|
| 118 | } |
|
| 119 | ||
| 120 | /** |
|
| 121 | * Validates the Ecuadorian Final Consumer |
|
| @@ 126-136 (lines=11) @@ | ||
| 123 | * @param $number |
|
| 124 | * @return string|null |
|
| 125 | */ |
|
| 126 | public function validateFinalConsumer($number) |
|
| 127 | { |
|
| 128 | $identification = new FinalCustomer(); |
|
| 129 | ||
| 130 | try { |
|
| 131 | return $identification->validate($number); |
|
| 132 | } catch (EcuadorIdentificationException $e) { |
|
| 133 | $this->setError($e->getMessage()); |
|
| 134 | return null; |
|
| 135 | } |
|
| 136 | } |
|
| 137 | ||
| 138 | /** |
|
| 139 | * Validate that the number belongs to natural persons. |
|