=== ValidaFirma – Firma electrónica simple para Chile ===
Contributors: redcumbre
Tags: electronic signature, e-signature, contracts, forms, chile
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send PDFs for signature from WordPress and get them back signed. Simple electronic signature under Chilean Law 19.799. By REDCUMBRE.

== Description ==

ValidaFirma lets you send a PDF for signature from your WordPress admin, follow the status of each document and download the signed one, without copying keys or writing code.

Simple electronic signature under Chilean Law 19.799. Signers verify their identity with their Chilean ID card and their face, and receive the invitation by email or WhatsApp.

The plugin interface is in Spanish (Chile), because ValidaFirma is a service for signers and companies in Chile. Button names are quoted below as they appear on screen, with their English meaning in parentheses.

**What it does**

* You connect your ValidaFirma account with one button. The site starts in test mode: the documents are samples, nothing is charged and no message is sent.
* "Enviar a firma" (send for signature): you upload a PDF, add the signers and send it. You choose the deadline, whether the document is confidential and whether each signer must confirm their email or phone number.
* A list split by mode (production and test) with the status of each document, where you can resend the invitation, cancel and download the signed PDF.
* The PDFs, original and signed, are stored in a private folder of your site, outside the Media Library.
* Notices from ValidaFirma are verified before the plugin acts on them and are processed only once. If your site cannot receive them, the plugin checks for anything pending every 15 minutes.
* A function and hooks for developers: `validafirma_enviar_a_firma()` and `validafirma_documento_firmado`, `validafirma_documento_rechazado`, `validafirma_documento_vencido`, `validafirma_documento_cancelado` and `validafirma_documento_no_emitido`.
* Integrations with form plugins, which turn on by themselves if the plugin is installed.
* WordPress personal data exporter and eraser, and suggested text for your privacy policy.

**Costs**

The plugin is free. Each signature is charged to the balance of your ValidaFirma account at the usual rate, per signer. Nothing is charged in test mode. On a corporate account, the usage is reported to your REDCUMBRE plan.

== External services ==

This plugin works with **ValidaFirma**, a service of REDCUMBRE SpA (https://validafirma.cl). Without a ValidaFirma account, the plugin cannot send documents for signature.

**What is sent and when**

* When you connect your account: the plugin opens the ValidaFirma connection page with the address of your site (its URL and its name) and, on the way back, exchanges a one-time code for the site key. The key is stored encrypted in your database and is never displayed.
* When you send a document for signature (from the admin, from an integrated form or from the site code): the PDF and, for each signer, their RUT, their name (if you provided it), their email or phone number, and the sending options (deadline, confidential, contact confirmation). When the company signs in a form, the identifier of the company signer.
* For follow-up: status queries for pending documents (at most once every 15 minutes per document), the download of the signed PDF, the cancellation and the resending of invitations that you order, the balance query and, in test mode, the simulation actions and simulated messages.
* Once a day, and whenever a notice cannot be verified: the plugin asks ValidaFirma whether the secret used to sign its notices has changed.
* When you disconnect: the plugin asks ValidaFirma to revoke the site key.

ValidaFirma (REDCUMBRE SpA) processes this data on behalf of your company, except for the verification of the signer's identity with PINRUT, which REDCUMBRE performs as data controller.

* Terms of service: https://validafirma.cl/terminos
* Privacy policy: https://validafirma.cl/privacidad
* Data processing: https://validafirma.cl/tratamiento-datos

**Request your integration**

In Settings there is a form to request the integration with a plugin that is not supported yet. Only when you press "Enviar" (send), your browser sends to the public forms endpoint of REDCUMBRE Comunicación (https://api.redcumbre.cl): the plugins you ticked, the address of your site (which the form shows as a read-only field), your email and the "Avísame cuando esté lista" (notify me when it is ready) checkbox, which comes unticked. REDCUMBRE uses this data only to reply to you about that integration and, if you tick the checkbox, to notify you once by email when it is ready. Privacy policy: https://redcumbre.cl/privacidad. If your site does not use https, the plugin shows a link to the form page instead of the form.

**What the plugin does not send**

The plugin sends no telemetry, no error reports and no installation notices to REDCUMBRE. Apart from the calls above, nothing leaves your site.

== Installation ==

1. Install the plugin from "Plugins > Add New" or upload the .zip file.
2. Activate it and open "ValidaFirma" in the admin menu.
3. Press "Conectar mi cuenta" (connect my account) and sign in to ValidaFirma. If you do not have an account, you can create one there.
4. Try it in test mode. When you are ready to send documents in production, use "Pasar a producción" (move to production) in Settings.

== Frequently Asked Questions ==

= How much does it cost? =

The plugin is free. Each signature is charged to your ValidaFirma balance at the usual rate; nothing is charged in test mode.

= What kind of signature is it? =

Simple electronic signature under Chilean Law 19.799.

= Where are the PDFs stored? =

In a private folder of your site (or in the one you set with the `VALIDAFIRMA_DIRECTORIO_PRIVADO` constant in wp-config.php, ideally outside the web root). Never in the Media Library. "Salud del sitio" (Site Health) warns you if your server allows downloading them by their address.

= How do I delete a person's data? =

With the WordPress personal data exporter and eraser, which search by email, or with "Borrar del sitio" (delete from the site) in the list of submissions. The ValidaFirma copy is not deleted from the site.

= What happens if I uninstall the plugin? =

Nothing is deleted unless you tick the Settings checkbox "Borrar también los PDF y los datos guardados en el sitio" (also delete the PDFs and the data stored on the site). The documents stay in ValidaFirma in both cases.

== Privacy ==

The plugin stores on your site the documents you send for signature, their status and the data of their signers (RUT, name, email or phone number). That copy belongs to you. The plugin adds suggested text to the WordPress privacy policy guide and registers a personal data exporter and eraser. The data sent to ValidaFirma is listed under "External services" above.

== Changelog ==

= 0.1.0 =
* First release.
