=== PixFácil – QR Code Pix Payments for WooCommerce ===
Contributors: wooglobalapps
Tags: pix, qr code, brazil, payment gateway, woocommerce
Requires at least: 6.0
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 Pix in WooCommerce: static Pix QR code and copy-and-paste code generated on your site from your Pix key, with optional Pix discount.

== Description ==

Pix is the instant payment system of the Banco Central do Brasil. **PixFácil** adds Pix as a payment method to your WooCommerce store using only your Pix key: no payment provider account, no API keys and no fees charged by the plugin.

After the customer places the order, PixFácil shows a **Pix QR code** and the **"Pix copia e cola" code** with the exact order amount. The customer pays in any Brazilian bank app, you see the money in your account and confirm the order with one click.

**Features**

* Pix payment method for WooCommerce, compatible with the classic checkout and the **Checkout block**.
* Static Pix (BR Code) generated locally following the Banco Central specification, with the order amount, receiver name, city, transaction ID (PIX + order number) and CRC16 checksum.
* Works with all Pix key types: CPF, CNPJ, email, phone and random key.
* QR code rendered in the customer's browser by a bundled library: no external QR code services.
* Copy button for the copy-and-paste code.
* QR code and code on the thank you page and on the My Account order page.
* Copy-and-paste code, amount and a link to the order page in the customer "on hold" email.
* Optional **Pix discount** (percentage of the products subtotal), shown in the totals of the classic checkout and of the Cart/Checkout blocks.
* **Confirm Pix payment** order action and orders list button: the order goes to Processing and a note is added.
* Custom instructions, order status after checkout (On hold or Pending payment) and an informational payment deadline.
* Compatible with HPOS (High-Performance Order Storage).
* Translation ready.

**How payment confirmation works**

PixFácil generates a *static* Pix code. Static Pix codes do not notify your store automatically: check that the payment arrived in your bank app (the transaction ID starts with PIX and the order number), then open the order and choose **Confirm Pix payment**.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the `pixfacil` folder to `/wp-content/plugins/` or install it from **Plugins → Add New**.
3. Activate PixFácil.
4. Go to **WooCommerce → Settings → Payments → Pix (PixFácil)**.
5. Choose the key type, enter your Pix key, the receiver name and the city exactly as registered in your bank, enable the method and save.

== Frequently Asked Questions ==

= Is the payment confirmed automatically? =

No. PixFácil uses a static Pix code, which does not send a payment notification to your store. When the money arrives in your bank account, confirm the order with **Order actions → Confirm Pix payment** or with the button in the orders list. Automatic confirmation requires a payment provider (dynamic Pix) and is not part of this plugin.

= Does PixFácil send my data or my customers' data anywhere? =

No. The Pix code and the QR code are generated on your own site and in the customer's browser. The plugin does not contact any external server, API or QR code service.

= Do I need an account with a payment company? =

No. You only need a Pix key registered in your bank account.

= Which Pix keys are supported? =

CPF, CNPJ, email, phone (with area code; the +55 country code is added automatically) and random key (EVP).

= Why are accents removed from the name and city? =

The Pix standard accepts only plain characters and limits the receiver name to 25 characters and the city to 15 characters. PixFácil converts them automatically.

= How does the Pix discount work? =

Set a percentage in the settings. When the customer selects Pix, a negative fee "Pix discount" is added, calculated on the products subtotal after coupons (shipping is not discounted). The QR code amount already includes the discount.

= Does it work with the Cart and Checkout blocks? =

Yes. Pix appears in the Checkout block and the discount is shown in the block totals when Pix is selected.

= Can the customer see the QR code later? =

Yes. The QR code stays available on the order page in My Account (and through the link in the email) while the order is On hold or Pending payment.

== Screenshots ==

1. Pix QR code and copy-and-paste code on the thank you page.
2. Pix in the Checkout block with the Pix discount.
3. Gateway settings.
4. Confirm Pix payment order action.

== Changelog ==

= 1.0.0 =
* First release.

== Third-party libraries ==

* QR Code Generator for JavaScript by Kazuhiko Arase, version 2.0.4, MIT license (https://github.com/kazuhikoarase/qrcode-generator), bundled in `assets/js/qrcode.js`.
