=== ONE for WooCommerce ===
Contributors: onelat
Tags: payments, latin america, usdc, crypto, checkout
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 8.0
WC tested up to: 11.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept local payments in 4 countries and crypto worldwide with ONE, and get settled in USDC dollars within minutes, with no chargebacks.

== Description ==

ONE for WooCommerce connects your store to [ONE](https://www.one.lat), a payment gateway built for Latin America. Your customers pay with their country's local method — bank transfer, PIX, PSE, SPEI, or cryptocurrency — and you get settled in USDC directly to your wallet, within minutes, with no need for a US LLC or a US dollar bank account.

= Why ONE =

* **Local payment methods**: bank transfer in Argentina, PIX in Brazil, PSE in Colombia, SPEI in Mexico, and crypto in any country.
* **Settlement in minutes, in USDC**: funds reach your wallet in minutes instead of days, with no banking intermediaries.
* **No chargebacks**: transfers and crypto payments are irreversible, unlike credit cards — once a payment is confirmed, it stays confirmed.
* **No infrastructure friction**: you don't need to open a US LLC or a US dollar bank account to start charging and settling in your store.
* **Native WooCommerce integration**: works with both classic checkout and Cart & Checkout Blocks, and is compatible with HPOS (High-Performance Order Storage).

= How it works =

1. The customer selects "ONE" as the payment method at your checkout.
2. Your store creates a Checkout Preference through the ONE API and redirects the customer to a secure, hosted payment page.
3. The customer pays with the local method available in their country.
4. ONE notifies the result via webhook. The plugin never trusts that notification on its own: it always makes an authenticated request back to the ONE API to confirm the real status before marking the order as paid.

= Supported currencies =

USD, ARS, BRL, COP, and MXN. If your store bills in another currency, the ONE payment method is automatically hidden at checkout.

= What you need =

An account with [ONE](https://www.one.lat) and your API credentials (API Key and API Secret). You can use the staging (test) environment at no cost to validate the full flow before switching to production.

== External services ==

This plugin connects to the ONE API (one.lat) to create payment preferences and confirm the status of your store's transactions. This connection is required for the payment method to work: without it, ONE cannot process payments for your orders.

Data sent, and when:

* **When an order is created**: the order amount and currency, an internal order identifier, and the customer's contact details (email, first name, last name, and phone number) provided at checkout are sent to the ONE API (`api.one.lat` in production, `api.stg.one.lat` in the staging environment) to generate the ONE hosted checkout.
* **When a status-change notification (webhook) is received**: the plugin makes an authenticated GET request, using your own credentials, to the ONE API to confirm the real status of the payment or refund before updating the order.

These requests only happen when a customer chooses to pay with ONE, and are required to complete the transaction.

More information:
[ONE Terms of Use](https://www.one.lat/terms)
[ONE Privacy Policy](https://www.one.lat/privacy)

== Installation ==

1. Install and activate WooCommerce if you haven't already.
2. Upload the `one-lat-for-woocommerce` folder to `/wp-content/plugins/`, or install the plugin directly from the WordPress plugin screen.
3. Activate the plugin through the **Plugins** menu.
4. Go to **WooCommerce > Settings > Payments > ONE** and enable the payment method.
5. Create an account with [ONE](https://www.one.lat) if you don't have one yet, and enter your API Key and API Secret.
6. Use the **Staging** environment to test the full flow with a test order before switching to **Production**.

== Frequently Asked Questions ==

= Do I need a ONE account to use this plugin? =

Yes. The plugin is a connector between your WooCommerce store and the ONE API — you need to create an account at [one.lat](https://www.one.lat) and generate your API credentials (API Key and API Secret) to accept payments.

= Which countries does it work in? =

The ONE API supports payments in Argentina, Brazil, Colombia, and Mexico with local methods, plus crypto in any country. The billing currencies supported by the plugin are USD, ARS, BRL, COP, and MXN.

= How is a payment confirmed? =

ONE notifies status changes via webhook, but the plugin never updates an order based on that notification alone: it always makes an authenticated GET request back to the ONE API to confirm the real status before marking the order as paid, rejected, or expired.

= Does the plugin process refunds automatically? =

No. The ONE API does not yet expose an endpoint to create refunds, only to look them up. When ONE confirms a refund, the plugin adds a note to the order so you can reconcile it manually — no automatic refund is created in WooCommerce.

= Is it compatible with Cart & Checkout Blocks and HPOS? =

Yes, both are explicitly declared and tested.

= What happens if my store bills in an unsupported currency? =

The ONE payment method is automatically hidden at checkout if the store's currency isn't one of the supported ones.

== Screenshots ==

1. ONE payment method settings under WooCommerce > Settings > Payments.
2. ONE as a payment option at WooCommerce checkout.

== Changelog ==

= 1.0.0 =
* Every request to the ONE API now sends two extra headers: `x-woocommerce-plugin-version` (the installed plugin version) and `x-origin: WOOCOMMERCE`, so ONE can identify the integration and enforce a minimum supported plugin version.

= 0.2.2 =
* Updated the plugin description (header and readme) to better reflect actual coverage: local payments in 4 countries and crypto worldwide, settlement in USDC dollars.

= 0.2.1 =
* Added a "Settings" link on the plugins list page (next to "Deactivate") linking directly to the gateway settings.

= 0.2.0 =
* Removed the embedded iframe checkout: both classic checkout and Checkout Blocks now do a full-page redirect to the ONE hosted checkout. This avoids failures in ONE's anti-bot challenge (Cloudflare/AWS WAF), which cannot complete inside a cross-origin iframe.
* Simplified the Cart & Checkout Blocks integration: it no longer depends on pre-creating a draft order or exposing its own REST endpoints for that.

= 0.1.4 =
* The payment method title shown to the customer (previously fixed per currency) is now editable per store in the gateway settings, with the same previous text as the default value.

= 0.1.3 =
* Removed the hardcoded minimum/maximum amounts: in Staging the error returned by the ONE API is shown as-is (useful for testing); in Production a generic, customer-facing message is shown instead, without exposing numbers that could become outdated relative to the real API.

= 0.1.2 =
* Errors returned by the ONE API when creating a Checkout Preference (amount out of range, invalid contact details, credentials, etc.) are now translated into specific messages for the customer, instead of a single generic message.

= 0.1.1 =
* First version of the embedded iframe checkout for Checkout Blocks (later replaced in 0.2.0 by the full-page redirect).
* Visible warning in Staging when the store's currency isn't supported or the order amount is out of range.

= 0.1.0 =
* Initial version: redirect-type gateway to the ONE hosted checkout.
* Payment confirmation via webhook with authenticated GET verification (the webhook payload is never trusted on its own).
* Logging of ONE refunds as an order note for manual reconciliation.
* Cart & Checkout Blocks integration and HPOS compatibility.
* Option to delete stored settings on uninstall.

== Upgrade Notice ==

= 1.0.0 =
Required update: the ONE API will stop accepting requests from plugin versions older than 1.0.0.

= 0.2.2 =
Checkout now does a full-page redirect instead of opening an embedded iframe, improving payment reliability — no action needed on your part.

= 0.1.0 =
First public release of the plugin.
