Rebuild Stripe payment processing foundation in Laravel #1

Closed
opened 2024-01-14 14:09:05 -06:00 by jimmyb · 3 comments
Owner

Stripe payment processing needs to be rebuilt in Laravel so MyVideoGameList can support donations now and paid account features later.

The current Laravel checkout does not have Stripe routes, controllers, configuration, SDK dependencies, checkout handling, webhook handling, or payment views wired up yet. Users do have a legacy stripe_id field, and the donation rebuild issue will depend on a safe Stripe foundation. This issue tracks establishing the Stripe integration pattern, configuration, checkout/session flow, webhook handling, and test coverage needed for donations and future subscriptions.

Scope

  • Stripe configuration and environment variables.
  • Stripe SDK or approved Laravel payment package setup.
  • Server-side Checkout Session creation for one-time payments.
  • Future subscription support using Stripe Billing and Checkout Sessions.
  • Stripe customer association for authenticated users where applicable.
  • Success, cancellation, and failure return handling.
  • Webhook handling for completed, failed, cancelled, and subscription-related events.
  • Receipt/confirmation messaging for successful payments or subscriptions.
  • Secure test coverage for payment creation, returns, webhooks, and secret handling.

Acceptance Criteria

  • Stripe keys, webhook secrets, price IDs, and mode settings are read from config/env and are never hard-coded.
  • The app uses Stripe Checkout Sessions for one-time payments such as donations.
  • Future recurring paid-account support is designed around Stripe Billing, Prices, Checkout Sessions, and Customer Portal rather than manual renewal logic.
  • Authenticated users can be associated with a Stripe customer ID without exposing Stripe internals publicly.
  • Guests can complete allowed one-time payments without creating an account unless a feature-specific issue says otherwise.
  • Successful checkout returns show a clear confirmation/thank-you state.
  • Cancelled checkout returns show a clear cancellation state.
  • Failed or invalid payment states show a safe error message without leaking provider details.
  • Stripe webhooks verify signatures before processing events.
  • Duplicate webhook delivery is handled idempotently.
  • Payment success/failure state is recorded or made available to feature-specific flows such as donations or paid accounts.
  • User-facing UI supports light/dark mode and follows existing Laravel/Tailwind site layout patterns.

Test Coverage Required

  • Feature/unit tests for Stripe configuration loading and missing-config failure behavior.
  • Feature tests for checkout/session creation using a fake or mocked Stripe client.
  • Feature tests confirming trusted server-side amounts/price IDs are used instead of client-submitted payment data.
  • Feature tests for success, cancel, and failure return routes.
  • Webhook tests for valid signature, invalid signature, duplicate event, payment success, payment failure, and subscription-related events where implemented.
  • Regression tests confirming Stripe secrets and webhook secrets are never rendered in HTML.
  • Tests confirming authenticated-user Stripe customer association where applicable.
  • Tests should use Pest and focused feature/unit coverage.
  • Run the focused affected tests, then run vendor/bin/pint --dirty before closing the issue.

Progress Checklist

  • Legacy users.stripe_id field exists
  • Choose the Stripe integration package/pattern for Laravel
  • Add Stripe configuration and required env keys
  • Add server-side Stripe Checkout Session creation
  • Add payment success, cancel, and failure routes/views
  • Add Stripe webhook endpoint with signature verification
  • Add idempotent webhook event handling
  • Add authenticated-user Stripe customer association where needed
  • Add donation-compatible one-time payment support
  • Document or prepare subscription-compatible Billing/Price/Customer Portal support
  • Add tests for config, checkout creation, returns, webhooks, idempotency, secret safety, and user association
  • Confirm Stripe foundation is ready for donation and paid-account feature issues
Stripe payment processing needs to be rebuilt in Laravel so MyVideoGameList can support donations now and paid account features later. The current Laravel checkout does not have Stripe routes, controllers, configuration, SDK dependencies, checkout handling, webhook handling, or payment views wired up yet. Users do have a legacy `stripe_id` field, and the donation rebuild issue will depend on a safe Stripe foundation. This issue tracks establishing the Stripe integration pattern, configuration, checkout/session flow, webhook handling, and test coverage needed for donations and future subscriptions. ## Scope - Stripe configuration and environment variables. - Stripe SDK or approved Laravel payment package setup. - Server-side Checkout Session creation for one-time payments. - Future subscription support using Stripe Billing and Checkout Sessions. - Stripe customer association for authenticated users where applicable. - Success, cancellation, and failure return handling. - Webhook handling for completed, failed, cancelled, and subscription-related events. - Receipt/confirmation messaging for successful payments or subscriptions. - Secure test coverage for payment creation, returns, webhooks, and secret handling. ## Acceptance Criteria - Stripe keys, webhook secrets, price IDs, and mode settings are read from config/env and are never hard-coded. - The app uses Stripe Checkout Sessions for one-time payments such as donations. - Future recurring paid-account support is designed around Stripe Billing, Prices, Checkout Sessions, and Customer Portal rather than manual renewal logic. - Authenticated users can be associated with a Stripe customer ID without exposing Stripe internals publicly. - Guests can complete allowed one-time payments without creating an account unless a feature-specific issue says otherwise. - Successful checkout returns show a clear confirmation/thank-you state. - Cancelled checkout returns show a clear cancellation state. - Failed or invalid payment states show a safe error message without leaking provider details. - Stripe webhooks verify signatures before processing events. - Duplicate webhook delivery is handled idempotently. - Payment success/failure state is recorded or made available to feature-specific flows such as donations or paid accounts. - User-facing UI supports light/dark mode and follows existing Laravel/Tailwind site layout patterns. ## Test Coverage Required - Feature/unit tests for Stripe configuration loading and missing-config failure behavior. - Feature tests for checkout/session creation using a fake or mocked Stripe client. - Feature tests confirming trusted server-side amounts/price IDs are used instead of client-submitted payment data. - Feature tests for success, cancel, and failure return routes. - Webhook tests for valid signature, invalid signature, duplicate event, payment success, payment failure, and subscription-related events where implemented. - Regression tests confirming Stripe secrets and webhook secrets are never rendered in HTML. - Tests confirming authenticated-user Stripe customer association where applicable. - Tests should use Pest and focused feature/unit coverage. - Run the focused affected tests, then run `vendor/bin/pint --dirty` before closing the issue. ## Progress Checklist - [x] Legacy `users.stripe_id` field exists - [x] Choose the Stripe integration package/pattern for Laravel - [x] Add Stripe configuration and required env keys - [x] Add server-side Stripe Checkout Session creation - [x] Add payment success, cancel, and failure routes/views - [x] Add Stripe webhook endpoint with signature verification - [x] Add idempotent webhook event handling - [x] Add authenticated-user Stripe customer association where needed - [x] Add donation-compatible one-time payment support - [x] Document or prepare subscription-compatible Billing/Price/Customer Portal support - [x] Add tests for config, checkout creation, returns, webhooks, idempotency, secret safety, and user association - [x] Confirm Stripe foundation is ready for donation and paid-account feature issues
Author
Owner

This has been built into our donation system and it's very easy to use! It should be simple to get it integrated with paid accounts. We can likely use multiple buttons with differing amounts.

This has been built into our donation system and it's very easy to use! It should be simple to get it integrated with paid accounts. We can likely use multiple buttons with differing amounts.
Author
Owner

Somewhat related. I got this when I subscribed to wowhead.com and I liked the "template":

Welcome to the ZAM Premium Service!

ZAM Network is pleased that you have chosen to support our ever growing community and look forward to providing you with even more exciting and revolutionary online gaming services in the future.
Here is your subscription information:
Transaction ID: 100525613062
Subscription: 1 month $1.00

Your subscription will expire on 2018-03-05.
You can cancel at any time by accessing your account settings and clicking OFF next to the date of renewal or by contacting us at accounts@zam.com.
If you cancel, you still may be charged for the current billing period.
More information about can be found at: FAQ

Thank you for using the ZAM Network for your online gaming needs.
Please keep this email for your records.
If you have any questions, please e-mail us at accounts@zam.com.

Somewhat related. I got this when I subscribed to wowhead.com and I liked the "template": > Welcome to the ZAM Premium Service! > > ZAM Network is pleased that you have chosen to support our ever growing community and look forward to providing you with even more exciting and revolutionary online gaming services in the future. > Here is your subscription information: > Transaction ID: 100525613062 > Subscription: 1 month $1.00 > > Your subscription will expire on 2018-03-05. > You can cancel at any time by accessing your account settings and clicking OFF next to the date of renewal or by contacting us at accounts@zam.com. > If you cancel, you still may be charged for the current billing period. > More information about can be found at: FAQ > > Thank you for using the ZAM Network for your online gaming needs. > Please keep this email for your records. > If you have any questions, please e-mail us at accounts@zam.com.
Codex changed title from Utilize Stripe for Payment Processing to Rebuild Stripe payment processing foundation in Laravel 2026-05-25 23:15:19 -05:00
jimmyb self-assigned this 2026-06-03 22:11:56 -05:00
Member

Implemented in 34366de (Build Stripe donation and billing foundation).

Notes for follow-up work:

  • Stripe integration uses Laravel Cashier v16, with App\Models\User using Billable and the legacy users.stripe_id kept as the customer identifier.
  • Config is env-backed through STRIPE_KEY, STRIPE_SECRET, STRIPE_WEBHOOK_SECRET, CASHIER_CURRENCY, donation settings, and STRIPE_PAID_ACCOUNT_PRICE_ID / STRIPE_PAID_ACCOUNT_SUBSCRIPTION_TYPE for future paid accounts.
  • Donations use server-side Stripe Checkout Sessions via a fakeable payment gateway and persist local donation state plus idempotent Stripe webhook event processing.
  • Paid-account groundwork now includes Cashier-compatible customer columns, subscriptions, subscription_items, a fakeable billing gateway, and an authenticated Customer Portal route.
  • Webhooks verify Stripe signatures and handle duplicate delivery before processing.

Verification:

  • php artisan test --compact tests/Feature/BillingFoundationTest.php tests/Feature/DonationTest.php passed: 21 tests, 102 assertions.
  • php artisan test --compact tests/Feature/RecentGamerUpdatesPageTest.php passed: 9 tests, 85 assertions.
  • git diff --check passed.
Implemented in `34366de` (`Build Stripe donation and billing foundation`). Notes for follow-up work: - Stripe integration uses Laravel Cashier v16, with `App\Models\User` using `Billable` and the legacy `users.stripe_id` kept as the customer identifier. - Config is env-backed through `STRIPE_KEY`, `STRIPE_SECRET`, `STRIPE_WEBHOOK_SECRET`, `CASHIER_CURRENCY`, donation settings, and `STRIPE_PAID_ACCOUNT_PRICE_ID` / `STRIPE_PAID_ACCOUNT_SUBSCRIPTION_TYPE` for future paid accounts. - Donations use server-side Stripe Checkout Sessions via a fakeable payment gateway and persist local donation state plus idempotent Stripe webhook event processing. - Paid-account groundwork now includes Cashier-compatible customer columns, subscriptions, subscription_items, a fakeable billing gateway, and an authenticated Customer Portal route. - Webhooks verify Stripe signatures and handle duplicate delivery before processing. Verification: - `php artisan test --compact tests/Feature/BillingFoundationTest.php tests/Feature/DonationTest.php` passed: 21 tests, 102 assertions. - `php artisan test --compact tests/Feature/RecentGamerUpdatesPageTest.php` passed: 9 tests, 85 assertions. - `git diff --check` passed.
Codex closed this issue 2026-06-03 23:33:12 -05:00
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#1
No description provided.