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>
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Payment;
|
|
|
|
use App\Enums\PaymentProvider;
|
|
use App\Models\ShoppingOrder;
|
|
use App\Models\ShoppingUser;
|
|
use App\Models\UserAbo;
|
|
use App\Services\Payment\Contracts\PaymentGatewayInterface;
|
|
use App\Services\Payment\DTOs\AboChargeResult;
|
|
use App\Services\Payment\Payone\PayonePaymentService;
|
|
|
|
/**
|
|
* Dünner Adapter, der den bestehenden PayonePaymentService hinter die
|
|
* provider-neutrale Gateway-Schnittstelle stellt. Enthält bewusst KEINE
|
|
* eigene Logik — PAYONE-Verhalten bleibt unverändert (Plan S1.3).
|
|
*/
|
|
class PayoneGateway implements PaymentGatewayInterface
|
|
{
|
|
public function __construct(private readonly PayonePaymentService $paymentService) {}
|
|
|
|
public function provider(): PaymentProvider
|
|
{
|
|
return PaymentProvider::Payone;
|
|
}
|
|
|
|
public function chargeAbo(
|
|
UserAbo $userAbo,
|
|
ShoppingOrder $shoppingOrder,
|
|
ShoppingUser $shoppingUser,
|
|
int $amountCents,
|
|
string $currency,
|
|
): AboChargeResult {
|
|
$result = $this->paymentService->chargeAbo(
|
|
$userAbo,
|
|
$shoppingOrder,
|
|
$shoppingUser,
|
|
$amountCents,
|
|
$currency,
|
|
);
|
|
|
|
return AboChargeResult::fromPayoneResult($result);
|
|
}
|
|
}
|