=== CatCode Payments with EBANX for WooCommerce ===
Contributors: catcodestudio
Tags: ebanx, oxxo, mexico, payments, woocommerce
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept OXXO Pay cash vouchers in Mexico through your own EBANX account.

== Description ==

Adds OXXO Pay as a payment method to WooCommerce, processed by [EBANX](https://www.ebanx.com/) with your own merchant account. The buyer places the order, gets a voucher with a barcode and pays it in cash at any OXXO store; the order is confirmed when EBANX tells the shop that the voucher was paid.

* **OXXO Pay voucher** — created with the EBANX Direct API for each order, in Mexican pesos or US dollars, with the number of days to pay that you choose (3 by default).
* **Payment instructions everywhere** — the amount, the barcode number, the due date and a link to the printable voucher are shown on the order-received page, in "My account → Orders" and in the order e-mail.
* **Settled by notification** — EBANX calls the shop; the signature of the call is checked, the payment is read again from EBANX (status, amount, currency, order reference) and only then the order is paid. A payment for a different amount puts the order on hold with a note. An expired voucher cancels the order.
* **Check payment status** — a button on the order screen asks EBANX for the payment if a notification did not arrive.
* **Check connection** — tells you at once whether the credentials fit the chosen account type (cross-border or local) and environment (sandbox or live).
* Integration key or JWS signature (RS256, private key and Key ID), as EBANX offers them. Credentials are stored encrypted.
* Works with the classic and the block checkout, HPOS.
* Translations included: English, Spanish (Mexico).

= Pro =

The Pro version is sold on [catcode.com.ua](https://catcode.com.ua/modules/catcode-payments-with-ebanx-for-woocommerce/), with a 7-day trial that never starts by itself:

* **SPEI bank transfer** — a CLABE account and reference for each order, shown to the buyer.
* **Cards** — Visa, Mastercard, American Express and Carnet; the card is turned into a token in the buyer's browser with EBANX.js, the card number never reaches the shop.
* **Aplazo** — buy now, pay later in Mexico; the buyer confirms the plan on Aplazo's page.
* **Pix and Boleto for Brazil** — with the CPF/CNPJ field at the checkout.
* **Refunds from WooCommerce** — a full or partial refund is sent to EBANX (cards, SPEI, Aplazo, Pix).
* **Hourly status check** of unpaid orders, in case a notification was lost, and a **bulk action** "Check EBANX payment status" on the orders list.
* **Cancelling an unpaid order** in the shop cancels its EBANX payment, so the voucher cannot be paid any more.
* Updates from catcode.com.ua.

The licence runs for 1-5 years and includes updates and support for that term; a purchased licence keeps its Pro features after the term ends. One key covers two sites: the shop and its test copy.

EBANX and OXXO are trademarks of their owners. This plugin is an independent integration made by CatCode; it is not an official plugin of EBANX and is not affiliated with or endorsed by it. You need your own EBANX merchant account.

== External services ==

The plugin connects to the EBANX API (EBANX S.A., [ebanx.com](https://www.ebanx.com/), documentation at [docs.ebanx.com](https://docs.ebanx.com/)) and only after you enter your credentials. The address depends on your account: `api.ebanxpay.com` / `sandbox.ebanxpay.com` (cross-border) or `api-local-latam.ebanxpay.com` / `sandbox-local-latam.ebanxpay.com` (local).

* When the buyer chooses OXXO Pay: the buyer's name, e-mail and phone number, the country, the amount and currency, the due date, an order reference, the address of the order-received page and the notification address of the shop.
* When a notification arrives, when you press "Check payment status" or "Check connection": the payment hash or the order reference, to read the payment.
* Pro methods also send the buyer's document number (CURP for Aplazo, CPF/CNPJ for Pix and Boleto) and billing address; cards send a card token made by EBANX.js. EBANX.js is loaded from `ebanx-js.ebanx.com` on the checkout when the card method is enabled, and receives the card details typed by the buyer.
* On a refund or a cancellation (Pro): the payment hash, the amount and the reason.
* With the integration key, the key goes with each request; with JWS each request is signed on your server and the private key never leaves it.

[EBANX privacy](https://trustcenter.ebanx.com/en-US/privacy) · [EBANX legal terms](https://trustcenter.ebanx.com/en-US/legal)

== Installation ==

1. Upload the plugin and activate it. WooCommerce must be active and the shop currency Mexican pesos or US dollars.
2. In WooCommerce → **EBANX** choose the account type and the environment, enter the integration key (or the JWS Key ID and private key), press "Check connection" and save.
3. Optional: enter the notification address shown on that screen in the EBANX Merchant Area (Account Settings → Integrations). The plugin also sends it with every payment.
4. WooCommerce → Settings → Payments: enable "OXXO Pay (EBANX)" and place a test order in the sandbox.

== Frequently Asked Questions ==

= Do I need an EBANX account? =

Yes. EBANX gives credentials after it approves the merchant; the plugin does not do the onboarding.

= Why is the order "on hold" after checkout? =

The voucher has not been paid yet. The order moves to Processing when EBANX reports the payment, and is cancelled when the voucher expires unpaid.

= Where does the buyer see the voucher? =

On the order-received page, in the order e-mail and in "My account → Orders": the barcode number, the amount, the due date and a link to the printable voucher.

== Changelog ==

= 1.0.0 =
* First release.
