@extends('layouts.layout-2') @section('content')

Payone-Callback Testbench

Erstbestellung Abo (realistisch): Zuerst legt der Checkout das Abo an (CheckoutControllerAboHelper::createNewAbo), danach meldet Payone per POST {{ route('api.payment_status', [], true) }} den Zahlungsstatus – dann laufen u. a. Payment::paymentStatusPaidAction, Abo-Freischaltung (setAboActive) und IncentiveTracker::trackAboActivated. Die Testbench-Schritte sind in dieser Reihenfolge angeordnet. Nur außerhalb Production.

@if (session('error'))
{{ session('error') }}
@endif
1. Test-Bestellung anlegen
@csrf
Bei is_for = me wird auth_user_id gesetzt; bei ot bleibt auth_user_id leer und member_id wird auf diese Berater-ID gesetzt.
@if (!empty($fixture))
Angelegte Testdaten
shopping_order_id
{{ $fixture['shopping_order_id'] }}
shopping_payment_id
{{ $fixture['shopping_payment_id'] }}
reference (16)
{{ $fixture['reference'] }}
amount (Cent)
{{ $fixture['amount_cents'] }} (= {{ number_format($fixture['amount_eur'], 2, ',', '.') }} €)
Berater-ID
{{ $fixture['consultant_user_id'] ?? '–' }}
Zuordnung
{{ $fixture['assignment_note'] ?? '' }}
API-URL
{{ $fixture['api_url'] }}

2. Checkout-Erfolg (nur Abo)

Wie handleSuccessfulTransaction / transactionApproved: AboHelper::createNewAbo($ShoppingPayment) – legt UserAbo + UserAboOrder an. Ohne vorherige payment_transactions wird eine Minimal-Transaktion angelegt.

@if (!empty($fixture['is_abo']))
@csrf
@else

Nicht-Abo – Schritt entfällt.

@endif

3. Payone-API: Zahlung bestätigt (paid)

Api\PayoneController::paymentStatusPayment::paymentStatusPaidAction (Abo freischalten, Incentive, …). Bei Abo-Erstbestellung nur nach Schritt 2 (sonst Fehlermeldung).

@csrf
@csrf
@php $benchUserAboId = $userAboId ?? ($checkoutSuccess['user_abo_id'] ?? null); @endphp @if (!empty($fixture['is_abo']) && $benchUserAboId)

4. Abo-Verlängerung (wie user:make_abo_order / Cron)

Setzt next_date auf heute, entfernt ggf. heutige user_abo_orders (Test-Wiederholung), führt dann UserMakeAboOrder::makeOrder aus (neue Bestellung + Payone). Anschließend Incentive-Zähler (z. B. qualifizierte Abos) und Umsatzpunkte prüfen – für Rechnung/SV wie in Produktion Schritt 5.

@csrf
Standard aus Session nach Schritt 2/3; anpassbar.
@endif @if (!empty($cronRenewalOrderId))

5. Payone-API: Verlängerung bestätigt (paid)

Wie Server-zu-Server-Callback nach Cron-Zahlung: Payment::paymentStatusPaidAction (Rechnung, createAndSalesVolumeIncentiveTracker::trackSalesVolume, …).

@csrf
@endif

Manuell (z. B. Postman / curl)

{{ $fixture['curl'] }}
@endif @if (!empty($simulateResult))
Ergebnis Schritt 3 (Payone-API)
@if (!empty($simulateResult['hint']))

{{ $simulateResult['hint'] }}

@endif
HTTP (Kernel)
{{ $simulateResult['http_status'] }}
Body
{{ $simulateResult['body'] }} (Payone erwartet TSOK)
Order paid
{{ $simulateResult['order_paid'] ? 'true' : 'false' }}
Order txaction
{{ $simulateResult['order_txaction'] ?? 'null' }}

Gesendeter Payload

{{ json_encode($simulateResult['payload'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@endif @if (!empty($checkoutSuccess))
Ergebnis Schritt 2 (Checkout / createNewAbo)
user_abo_id
{{ $checkoutSuccess['user_abo_id'] ?? '–' }}
user_abo_orders.id
{{ $checkoutSuccess['user_abo_order_id'] ?? '–' }}
shopping_order_id
{{ $checkoutSuccess['shopping_order_id'] ?? '–' }}
Order paid (nachher)
{{ !empty($checkoutSuccess['order_paid_after']) ? 'true' : 'false' }}
@if (!empty($checkoutSuccess['hint']))

{{ $checkoutSuccess['hint'] }}

@endif
@endif @if (!empty($cronRenewal))
Ergebnis Schritt 4 (Cron-Verlängerung)
Erfolg
{{ !empty($cronRenewal['success']) ? 'true' : 'false' }}
@if (!empty($cronRenewal['shopping_order_id']))
Neue shopping_order_id
{{ $cronRenewal['shopping_order_id'] }}
@endif @if (!empty($cronRenewal['user_abo_id']))
user_abo_id
{{ $cronRenewal['user_abo_id'] }}
@endif @if (!empty($cronRenewal['message']))
Hinweis
{{ $cronRenewal['message'] }}
@endif @if (!empty($cronRenewal['diagnosis']))
Diagnose
{{ json_encode($cronRenewal['diagnosis'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@endif
@if (!empty($cronRenewal['hint']))

{{ $cronRenewal['hint'] }}

@endif
@endif @endsection