=== Pay4All for Stripe - For WooCommerce & Pay4All Shop ===
Contributors: pay4all
Tags: stripe, payment, woocommerce, gateway, apple-pay
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds Stripe as a payment gateway to WooCommerce and Pay4All Shop. Free, no license, no subscription. Uses your own Stripe API keys.

== Description ==

Pay4All for Stripe adds Stripe as a payment method to WooCommerce and to the free Pay4All Shop plugin.

Stripe is a trademark of Stripe, Inc.; this plugin is an independent integration and is not affiliated with, endorsed by, or sponsored by Stripe, Inc.

Main features:

* Connects your own Stripe account by pasting your Publishable key and Secret key — no OAuth, no third-party proxy.
* Auto-creates the webhook endpoint in your Stripe account with a single click.
* Every method enabled in your Stripe account shows up at checkout: cards, Apple Pay, Google Pay, SEPA, iDEAL, Klarna, and more.
* WooCommerce integration: classic checkout, Checkout Blocks and HPOS supported.
* Pay4All Shop integration: works out of the box with form-based checkouts.
* Refunds triggered directly from the order screen.
* Localized in French, German, Italian and English.
* Test mode / Live mode toggle.

There is no license fee, no subscription, no domain activation. Install, activate, paste your Stripe keys, done.

== Installation ==

1. Upload the `pay4all-for-stripe` folder to `/wp-content/plugins/` (or install from Plugins > Add New).
2. Activate "Pay4All for Stripe" from the WordPress Plugins screen.
3. Open `Pay4All STRIPE > Paramètres` in the admin.
4. In your Stripe dashboard, go to Developers > API keys and copy your Publishable key + Secret key. Paste them into the plugin settings.
5. Click "Create webhook" — the plugin registers the webhook endpoint in your Stripe account automatically.
6. Tick which Stripe payment methods you want to expose at checkout.

Server requirements:

* PHP 7.4 or higher.
* PHP extensions: `openssl`, `curl`.
* WordPress 5.9 or higher.
* WooCommerce and/or Pay4All Shop.

== External services ==

This plugin connects to the Stripe API (operated by Stripe, Inc.) to authorize, capture, refund and reconcile payments. Without a Stripe account and valid API keys, the gateway cannot process payments.

**What it is used for**

* Every payment initiated from a WooCommerce or Pay4All Shop checkout is forwarded to Stripe for authorization.
* Webhook events from Stripe are received to mark orders as paid, refunded or failed.
* Refunds triggered from the WordPress admin call the Stripe refund API.
* Creating the webhook endpoint at first setup calls the Stripe API endpoints webhook_endpoints and creates the local endpoint URL.

**What data is sent, and when**

* On payment start: the order number, amount, currency and customer email.
* On webhook: only the Stripe event data returned by Stripe.
* On refund: the Stripe PaymentIntent identifier and the amount to refund.
* No login credentials, no plugin telemetry, no site metadata are sent.

**Where the data is sent**

The plugin talks to Stripe's REST API at:

* https://api.stripe.com — the Stripe REST API used for every payment operation.

**Terms of use and privacy policy for Stripe**

* Stripe terms of service: https://stripe.com/legal/ssa
* Stripe privacy policy: https://stripe.com/privacy

No other external service is contacted by this plugin.

== Source code ==

The complete, non-minified source of this plugin is bundled inside the ZIP itself. Every PHP file is human-readable and directly editable. The JavaScript bundles under `assets/js/` are shipped in a pretty-printed, non-minified form so you can read and modify them without a build step.

The bundled Stripe PHP SDK under `lib/stripe-php/` is the official Stripe SDK, released under MIT license, unmodified. Source: https://github.com/stripe/stripe-php.

== Screenshots ==

1. Wizard step 1 - paste your Stripe **test** publishable and secret keys to try the gateway safely.
2. Wizard step 2 - switch to **production** by pasting your live Stripe keys ; the plugin flips the mode with a single click.
3. Wizard step 3 - one-click **webhook creation** in your Stripe account, no manual endpoint URL to copy.
4. Wizard step 4 - tick the **Stripe payment methods** you want to expose at checkout (cards, Apple Pay, Google Pay, SEPA, iDEAL, Klarna, TWINT, and more).
5. Wizard step 5 - configure the WooCommerce and Pay4All Shop **order statuses** applied after a successful, deferred or failed Stripe payment.

== Frequently Asked Questions ==

= Does the plugin require a Pay4All account? =

No. This plugin is fully free and works standalone with your own Stripe account. You only need Stripe API keys.

= Does it work without WooCommerce? =

Yes. The plugin also integrates with the free Pay4All Shop plugin (order-form-based checkouts). You need at least one of the two.

= Where do I get my Stripe API keys? =

Log in to your Stripe dashboard, go to Developers > API keys. Copy the Publishable key and the Secret key. Paste both into the plugin settings.

= How is the webhook set up? =

After you save your API keys, click "Create webhook" in the plugin settings. The plugin uses your secret key to register the webhook endpoint automatically in your Stripe account. The webhook signing secret is captured and stored for signature verification.

= Is WordPress Multisite supported? =

Not in this version. Activate the plugin site by site.

== Changelog ==

= 1.3.0 =
* **i18n refactor - source strings converted to English.** All user-facing strings in the plugin code are now in English, matching the WordPress i18n convention (`msgid` = English source, `msgstr` = translation). Full translation packs validated and bundled for French (fr_FR), German (de_DE) and Italian (it_IT) under `/localization/`.
* No behaviour change, no configuration change, no manual action required.

= 1.2.0 =
* Fix bug WooCommerce.

= 1.1.1 =
* UX : the Pay4All Shop checkout row for the Stripe method now lists every payment method the merchant activated in the wizard (« Visa, Mastercard, Amex, Google Pay, Klarna, … ») instead of the generic « Carte bancaire ». Falls back to « Carte bancaire » when no method is enabled.

= 1.1.0 =
* Fix : payment methods fetched live from the merchant's Stripe account (Amazon Pay, Twint, Pix, Link, Cash App Pay, iDEAL, Bancontact, etc.) were silently dropped when saved. The internal `enabled_methods()` filter and both save handlers (wizard step 4 + WooCommerce settings) intersected the saved slugs with a tiny static whitelist of 6 methods, stripping every non-hardcoded slug before it reached the checkout. The recap on wizard step 6 was also miscounting (« 3 modes selected » when 5 were checked). Whitelist removed - saved slugs are validated by `sanitize_key` + a strict `[a-z0-9_]+` regex, and forwarded to Stripe's `payment_method_types` as-is.
* Fix : mode toggle (test ⇄ production) redirected to wizard step 5 even when triggered from step 6, kicking the merchant back one step. The mode-cursor form now carries a hidden `redirect_step` field read from the current URL, and the shared `redirect_back()` handler routes back to that step (clamped to 1-20 with step 5 as fallback).

= 1.0.1 =
* Added screenshots covering the 5 setup wizard steps (test keys, production keys, webhook, payment methods, order statuses).
* Housekeeping : uniform prefix `pay4all_for_stripe_` on every PHP constant, namespace, JS/CSS handle and JS global variable. No behaviour change ; no migration required.

= 1.0.0 =
* Initial release on WordPress.org.
* Direct Stripe integration via API keys (no third-party proxy).
* WooCommerce classic checkout + Checkout Blocks + HPOS support.
* Pay4All Shop integration.
* French, German, Italian and English translations bundled.

== Upgrade Notice ==

= 1.3.0 =
i18n refactor: plugin source strings now in English (WordPress convention). Full translation packs bundled for French, German and Italian. No configuration change, no manual action.

= 1.2.0 =
Fix bug WooCommerce.

= 1.1.1 =
UX polish : the Pay4All Shop checkout now lists every activated Stripe method (Visa, Mastercard, Amex, Google Pay, Klarna, Twint, …) instead of a generic « Carte bancaire ». Safe upgrade, no configuration change.

= 1.1.0 =
Bug-fix : payment methods enabled on Stripe (Twint, Amazon Pay, Pix, Link, iDEAL, Bancontact, …) now reach the checkout instead of being silently stripped to cards / Apple Pay / Google Pay. Wizard recap counter also fixed. Recommended for anyone using anything else than plain cards.

= 1.0.1 =
Cosmetic release : screenshots added to the plugin directory listing and internal prefixes unified. Safe to upgrade, no configuration change needed.

= 1.0.0 =
Initial release on WordPress.org. Free, no license, no subscription.
