=== SwiftInvoice for WooCommerce ===
Contributors: swiftinvoice
Tags: woocommerce, invoice, pdf invoice, billing, woocommerce pdf
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.3.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically generate professional PDF invoices with PIX, SWIFT/IBAN and multi-language support for every WooCommerce order.

== Description ==

**SwiftInvoice for WooCommerce** connects your store to the SwiftInvoice API and automatically generates a professional PDF invoice for every order — complete with PIX QR Code (Brazil), bank details, multi-currency support, and three beautiful templates. Upgrade to PRO or above to remove the invoice watermark and deliver fully white-label invoices to your customers.

= Features =

* ✅ Automatic PDF generation on every order
* 💸 Native PIX QR Code support (Brazil)
* 🌎 Multi-language: English, Portuguese (Brazil), Spanish
* 💱 Multi-currency: BRL, USD, EUR, GBP, JPY
* 🎨 3 templates: Blue, Modern (Purple), Minimalist (Dark)
* 📧 PDF automatically attached to customer order emails
* 📥 Customer PDF download in My Account area (secure token link)
* ⚡ Manual generation button in order admin panel
* 🏦 Brazil: PIX key, bank branch, account details, CNPJ
* 🌍 International: SWIFT/BIC, IBAN, account number
* 🔒 Secure PDF storage (protected from direct access)
* ⚙️ Configurable trigger: Processing, Completed, or On Hold
* 🏷️ **PRO and above: invoice watermark removed automatically**

= How It Works =

1. Install and activate the plugin
2. Go to **WooCommerce → SwiftInvoice**
3. Create a free account at [RapidAPI](https://rapidapi.com/limaandreasantos/api/swiftinvoice) and paste your key
4. Fill in your company details, PIX key or bank info
5. Done! Every order automatically gets a PDF invoice

= Plans =

* **BASIC** — Free (50 invoices/month) — includes "Generated by SwiftInvoice" watermark on invoices
* **PRO** — $9/month (500 invoices/month) — **removes watermark from all invoices**
* **ULTRA** — $25/month (3,000 invoices/month) — **no watermark**
* **MEGA** — $50/month (15,000 invoices/month) — **no watermark**

On paid plans, the "Generated by SwiftInvoice" footer is automatically removed from every PDF — giving your invoices a fully branded, professional appearance.

= Requirements =

* WordPress 5.8+
* WooCommerce 6.0+
* PHP 7.4+
* A free RapidAPI account

== Installation ==

1. Upload the `swiftinvoice-woo` folder to `/wp-content/plugins/`
2. Activate the plugin under **Plugins → Installed Plugins**
3. Go to **WooCommerce → SwiftInvoice** to configure

== Frequently Asked Questions ==

= Do I need a RapidAPI account? =
Yes. Create your free account at rapidapi.com — the BASIC plan is free and includes 50 invoices per month.

= Does the invoice replace a legal tax document (Nota Fiscal)? =
No. SwiftInvoice generates a professional billing document. For Brazilian tax invoices (NF-e), use a dedicated fiscal system.

= Does PIX really work? =
Yes! The PIX QR Code is generated using the official Central Bank of Brazil payload format (BR.GOV.BCB.PIX) and can be scanned by any Brazilian banking app.

= Does it work outside Brazil? =
Yes. For non-BRL currencies or non-Portuguese languages, the plugin automatically shows SWIFT/IBAN fields instead of PIX and Brazilian bank fields.

= Does it work on Windows servers? =
Yes. The plugin handles Windows path separators automatically.

= Will the invoice be sent by email automatically? =
Yes. The PDF is attached to the WooCommerce order confirmation email sent to the customer automatically.

= Can customers download their invoice? =
Yes. A secure download button appears on the order detail page in the customer's My Account area.

= What is the invoice watermark? =
On the BASIC (free) plan, invoices include a small "Generated by SwiftInvoice" footer. On PRO, ULTRA, and MEGA plans, this watermark is automatically removed — giving your invoices a fully branded, white-label appearance. No configuration needed; the API detects your plan and removes the footer automatically.

== Screenshots ==

1. Plugin settings page
2. Example PDF invoice with PIX QR Code
3. Manual generation button in order admin panel
4. Customer download button in My Account

== Changelog ==

= 1.3.0 =
* Fixed Windows path separator issue for PDF storage and email attachment
* PRO/ULTRA/MEGA plans: footer branding removed automatically (API-side)
* Removed all debug logging from production code
* Added customer_invoice to supported email types

= 1.2.0 =
* Full English interface with i18n support
* Included pt_BR translation
* Dynamic payment fields based on language/currency selection
* International bank fields: SWIFT/BIC and IBAN

= 1.1.0 =
* Customer PDF download in My Account area (secure token link)

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.3.0 =
Fixes PDF email attachment on Windows servers. Recommended for all users.
