# Stripe payment integration — LimoBookingSoftware v2.1

Adds Stripe as a booking payment gateway alongside PayPal and Authorize.net, via
Stripe Checkout (hosted redirect). Mirrors this app's own PayPal wiring
(pjFrontPublic param builder + pjFrontEnd confirm; bookings / bookings_payments).

## What was added
- Plugin `app/plugins/pjStripe/` (PLUGIN_ID 303): `plugin_stripe` table; adds
  `stripe` to `bookings`/`bookings_payments` enums; seeds `o_allow_stripe` +
  `o_stripe_public_key`/`o_stripe_private_key` (tab 2) + method label; Stripe
  Checkout over the framework `pjHttp`.
- `app/config/options.inc.php` — `pjStripe` registered
- `app/controllers/pjFrontPublic.controller.php` — `case 'stripe'` param builder
- `app/controllers/pjFrontEnd.controller.php` — `pjActionConfirmStripe()` return
  handler (mirrors `pjActionConfirmPaypal`, looks the booking up by id)
- `app/views/pjFrontPublic/pjActionGetPaymentForm.php` — `case 'stripe'` render
- `app/views/pjAdminOptions/pjActionBooking.php` — Stripe key rows grouped under
  the Allow-Stripe toggle
- `app/web/js/pjAdminOptions.js` — show/hide toggle

## Migration notes
- Labels use the `::LOCALE::` token, which THIS app's pjInstaller expands (its own
  pjPaypal plugin uses the same token). Install the plugin SQL through the installer
  so the token expands; if running raw SQL by hand, replace `::LOCALE::` with your
  locale id(s).
- Stripe options are placed contiguously on the Payments tab right after the
  Authorize.net block: **Allow Stripe (17) → publishable key (18) → secret key
  (19)**, and the offline methods (cash/credit-card/bank/bank account) shift to
  22–25. So the tab reads PayPal → Authorize → Stripe → cash/card/bank.

## Install
1. Deploy this project (or copy over your v2.1 tree).
2. Run `app/plugins/pjStripe/config/database.sql` (via the installer, per above).
3. Add `'pjStripe'` to the plugins array in your `config.inc.php` / `config.sample.php`.
4. Admin → Options → Payments: set **Allow Stripe payments = Yes** and enter your keys.

## Flow
Customer picks Stripe at checkout (shown when `o_allow_stripe = Yes`) → redirected to
Stripe Checkout → returns to `pjFrontEnd::pjActionConfirmStripe`, which verifies the
session, marks the booking (`o_payment_status`, `txn_id`) and its online payment row
`paid`, sends the confirmation email, and redirects to the thank-you page.

## Notes
- All Stripe calls use the framework `pjHttp`; no third-party SDK is bundled.
- SQL couldn't be executed here (no database); run it against staging first.
- Test vs live is determined by the key prefix.
