=== FiscoBridge for WooCommerce ===
Contributors: fiscobridge
Tags: woocommerce, fiscal receipt, tax, invoice, compliance
Requires at least: 6.2
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

Delivers FiscoBridge fiscal receipts to your WooCommerce customers by email, on the thank-you page and in My Account.

== Description ==

FiscoBridge fiscalizes your WooCommerce orders in the cloud. This plugin delivers the resulting fiscal receipt to your customer:

* A customer email with the fiscal receipt PDF attached, editable under WooCommerce > Settings > Emails.
* A "Download fiscal receipt" link on the order thank-you page and in My Account.
* A FiscoBridge box on the order screen showing each fiscal document, its verification link and whether it was issued in training mode.

Refunds are handled the same way: each fiscal refund receipt is delivered to the customer when it is issued.

Documents issued in training mode are never sent to customers and never shown to them.

The plugin does not talk to a tax server and stores no FiscoBridge credentials. Your store is connected to FiscoBridge from the FiscoBridge client portal, using the "Connect to FiscoBridge" button under WooCommerce > FiscoBridge.

**FiscoBridge is a paid service and a FiscoBridge account is required.** Every feature of this plugin works the same for every account. Issuing live fiscal receipts requires a paid FiscoBridge plan; testing with training invoices does not.

== External services ==

This plugin relies on the FiscoBridge fiscalization service in these ways:

* Receipt download: the plugin downloads each fiscal receipt PDF from the FiscoBridge receipt service at pos.fiscobridge.com so that it can be attached to the customer email and offered for download. The request is made once per fiscal document and contains only the receipt address that FiscoBridge stored on the order; no customer or store data is sent. If a receipt cannot be stored locally, the customer is redirected to the same address.
* Connect button: when a store administrator selects "Connect to FiscoBridge" under WooCommerce > FiscoBridge, the browser opens the FiscoBridge client portal at client.fiscobridge.com with the store's site address in the link. Nothing is sent until the administrator selects the button.
* Status check: the plugin adds a public endpoint, /wp-json/fiscobridge/v1/status, that returns only the plugin name and version. FiscoBridge checks the store's REST API index (/wp-json/) for this endpoint's namespace to know whether to leave receipt emails to the plugin.
* Store connection: connecting the store in the FiscoBridge client portal asks the store administrator to approve a read/write WooCommerce REST API key on WooCommerce's own approval screen. FiscoBridge uses that key to read orders, refunds and tax rates, including the customer details on the orders, so that it can fiscalize them, and to write the fiscal documents and order notes back to the orders. It also adds an order webhook named "FiscoBridge order updated". This data is exchanged by WooCommerce through the approved key, not by this plugin. Revoking the key under WooCommerce > Settings > Advanced > REST API stops it.

Service provider: FiscoBridge, https://www.fiscobridge.com/
Terms of service: https://fiscobridge.com/legal/terms-and-conditions
Privacy policy: https://fiscobridge.com/legal/privacy-policy

Downloaded receipts are stored in wp-content/uploads/fiscobridge-receipts/ and are served only through a permission-checked download link.

== Installation ==

1. Upload the plugin and activate it. WooCommerce 8.0 or later is required.
2. Go to WooCommerce > FiscoBridge and select "Connect to FiscoBridge" to link your store in the FiscoBridge client portal.
3. Fiscal receipts are delivered automatically once your orders are fiscalized.

== Frequently Asked Questions ==

= Do I need a FiscoBridge account? =

Yes. The plugin delivers receipts that FiscoBridge produces, so an account is required. Going live requires a paid plan.

= Does it work with High-Performance Order Storage? =

Yes. The plugin declares compatibility and uses only WooCommerce order APIs.

= Can I change the email? =

Yes. Edit the "Fiscal receipt" email under WooCommerce > Settings > Emails.

= Where are the receipt PDFs stored? =

In wp-content/uploads/fiscobridge-receipts/, in a folder that web servers are told to deny. Receipts can only be downloaded through the order's download link.

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
