Download the PHP package tavo1987/ec-validador-cedula-ruc without Composer

On this page you can find all versions of the php package tavo1987/ec-validador-cedula-ruc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ec-validador-cedula-ruc

Ecuador ID (Cedula) and RUC Validator

Tests PHP 8.2+ License Total Downloads Latest Stable Version

A PHP library for validating Ecuadorian identification documents:

Requirements

Installation

Usage

Basic Setup

Quick Validation (Static Methods)

For simple validation without creating an instance:

Universal Validation (Auto-detect document type)

The validate() method automatically detects and validates any document type:

Specific Validation Methods

If you know the document type beforehand:

Extract Cedula from RUC

For Natural Person RUC, you can extract the cedula portion:

Available Constants

API Reference

Static Methods

Method Description
ValidadorEc::isValid(string $number) Quick validation of any document type
ValidadorEc::isValidCedula(string $number) Quick cedula validation
ValidadorEc::isValidNaturalPersonRuc(string $number) Quick natural person RUC validation
ValidadorEc::isValidPrivateCompanyRuc(string $number) Quick private company RUC validation
ValidadorEc::isValidPublicCompanyRuc(string $number) Quick public company RUC validation

Instance Methods

Method Description
validate(string $number) Auto-detect and validate any document
validateCedula(string $number) Validate Cedula (10 digits)
validateNaturalPersonRuc(string $number) Validate Natural Person RUC (13 digits)
validatePrivateCompanyRuc(string $number) Validate Private Company RUC (13 digits)
validatePublicCompanyRuc(string $number) Validate Public Company RUC (13 digits)
extractCedulaFromRuc(string $ruc) Extract cedula from natural person RUC
getDocumentType() Get detected document type after validation
getError() Get error message from last validation

Document Structure

Document Type Digits Third Digit Algorithm
Cedula 10 0-5* Modulo 10
RUC Natural Person 13 0-5* Modulo 10
RUC Private Company 13 9 Modulo 11
RUC Public Company 13 6 Modulo 11

*For province code 30, third digit validation is skipped (see below).

Province Codes

The first two digits represent the province:

Code Province
01 Azuay
02 Bolivar
03 Cañar
04 Carchi
05 Cotopaxi
06 Chimborazo
07 El Oro
08 Esmeraldas
09 Guayas
10 Imbabura
11 Loja
12 Los Rios
13 Manabi
14 Morona Santiago
15 Napo
16 Pastaza
17 Pichincha
18 Tungurahua
19 Zamora Chinchipe
20 Galapagos
21 Sucumbios
22 Orellana
23 Santo Domingo de los Tsachilas
24 Santa Elena
30 Foreign residents

Foreign Residents (Code 30)

Province code 30 is for "ecuatorianos registrados en el exterior" (Ecuadorians abroad) and foreign residents:

Validation Limitations

This library uses algorithmic validation (Modulo 10/11). Known limitations:

  1. Foreign natural persons without cedula: RUCs for foreigners may not follow standard validation. Verify through SRI web services.

  2. Critical applications: Consider complementing with official SRI database queries.

Testing

Changelog

v2.0.0

v1.0.2

v1.0.0

License

MIT License - see LICENSE file for details.

Authors

Edwin Ramirez

Bryan Suarez


All versions of ec-validador-cedula-ruc with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tavo1987/ec-validador-cedula-ruc contains the following files

Loading the files please wait ...