Stripe-Integration (S0–S3): Einmalzahlungen über Stripe Checkout + Notfall-Go-Live
Wegen PAYONE-Ausfall vorgezogen live geschaltet: alle Einmalzahlungen (Shop + Salescenter) laufen über Stripe Hosted Checkout, Abos sind bis Phase S4 eingefroren. - Provider-Abstraktion: PaymentProvider-Enum, PaymentGatewayInterface, PaymentProviderManager (Settings-Schalter, provider-treu je Bestand), PayoneGateway als unveränderter Adapter - StripePaymentService: Checkout Session (eine Gesamtposition, Metadata, success/cancel-Redirects), StripeClientWrapper (lazy, Dark Launch), StripeCustomerService, StripeTransactionRecorder (client_secret-Redaction) - Webhook /stripe/webhook: Signaturprüfung, Idempotenz über stripe_webhook_events (Crash-Retry-Reprocessing), txaction-Prioritäten, Betrags-Guard, lockForUpdate-Paid-Pfad, genau eine Bestätigungsmail - Zahlungsmethoden-Anzeige aus charge.succeeded (carddata inkl. Wallet, auftragsunabhängiges Backfill aus dem Event-Store) - Checkout: Wartungsmodus mit Admin-Bypass, Abo-Freeze-Hinweis, Stripe-Option (Online-Zahlung) statt Zahlartenwahl, Vorkasse ausblendbar - Abo-Freeze-Guards: Cron user:make_abo_order, Retry, Kartenupdate - Admin-Settings-Karte Zahlungen (Provider, Wartung, Freeze, Vorkasse) - Hotfix: 500 bei Vorkasse ohne Clearing-Daten in admin/sales/_detail und checkout-final (PAYONE-Ausfall) - Doku dev/2026-07-08-stripe/ (Plan S0–S8, Konzept, IST-Analyse) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
1108381988
commit
e1da90ff91
48 changed files with 4428 additions and 831 deletions
49
app/Services/Payment/Stripe/DTOs/StripeWebhookResult.php
Normal file
49
app/Services/Payment/Stripe/DTOs/StripeWebhookResult.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\Payment\Stripe\DTOs;
|
||||
|
||||
/**
|
||||
* Ergebnis der Stripe-Webhook-Verarbeitung. Anders als beim PAYONE-IPN
|
||||
* (immer "TSOK") steuert der HTTP-Status das Retry-Verhalten von Stripe:
|
||||
* 2xx = erledigt, alles andere wird erneut zugestellt.
|
||||
*/
|
||||
class StripeWebhookResult
|
||||
{
|
||||
private function __construct(
|
||||
public readonly int $statusCode,
|
||||
public readonly string $state,
|
||||
public readonly ?string $eventId = null,
|
||||
public readonly ?string $eventType = null,
|
||||
public readonly ?string $reason = null,
|
||||
) {}
|
||||
|
||||
/** Signatur ungültig oder Payload kein gültiges Event — kein Retry sinnvoll. */
|
||||
public static function invalidSignature(string $reason): self
|
||||
{
|
||||
return new self(statusCode: 400, state: 'invalid_signature', reason: $reason);
|
||||
}
|
||||
|
||||
/** STRIPE_WEBHOOK_SECRET fehlt — 500, damit Stripe später erneut zustellt. */
|
||||
public static function notConfigured(): self
|
||||
{
|
||||
return new self(statusCode: 500, state: 'not_configured', reason: 'STRIPE_WEBHOOK_SECRET missing');
|
||||
}
|
||||
|
||||
/** Event-ID bereits verarbeitet — Retry wird bestätigt, aber ignoriert. */
|
||||
public static function duplicate(string $eventId, string $eventType): self
|
||||
{
|
||||
return new self(statusCode: 200, state: 'duplicate', eventId: $eventId, eventType: $eventType);
|
||||
}
|
||||
|
||||
/** Gültiges Event eines nicht behandelten Typs — protokolliert, bestätigt. */
|
||||
public static function ignored(string $eventId, string $eventType): self
|
||||
{
|
||||
return new self(statusCode: 200, state: 'ignored', eventId: $eventId, eventType: $eventType);
|
||||
}
|
||||
|
||||
/** Event verarbeitet (Transaktion protokolliert, Folgeaktionen angestoßen). */
|
||||
public static function processed(string $eventId, string $eventType): self
|
||||
{
|
||||
return new self(statusCode: 200, state: 'processed', eventId: $eventId, eventType: $eventType);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue