- Brand/Theming: Marketing-Farb- und Typographievariablen in `resources/css/app.css` eingeführt, AdminLayout, Dashboardkarten und Onboarding-Komponenten entsprechend angepasst; Dokumentation (`docs/todo/tenant-admin-onboarding-fusion.md`, `docs/changes/...`) aktualisiert. - Checkout & Payments: Checkout-, PayPal-Controller und Tests für integrierte Stripe/PayPal-Flows sowie Paket-Billing-Abläufe überarbeitet; neue PayPal SDK-Factory und Admin-API-Helper (`resources/js/admin/api.ts`) schaffen Grundlage für Billing/Members/Tasks-Seiten. - DX & Tests: Neue Playwright/E2E-Struktur (docs/testing/e2e.md, `tests/e2e/tenant-onboarding-flow.test.ts`, Utilities), E2E-Tenant-Seeder und zusätzliche Übersetzungen/Factories zur Unterstützung der neuen Flows. - Marketing-Kommunikation: Automatische Kontakt-Bestätigungsmail (`ContactConfirmation` + Blade-Template) implementiert; Guest-PWA unter `/event` erreichbar. - Nebensitzung: Blogsystem gefixt und umfassenden BlogPostSeeder für Beispielinhalte angelegt.
2.2 KiB
2.2 KiB
PayPal SDK Migration to v1 Server SDK
Summary
Migrated from deprecated paypal/paypal-checkout-sdk to paypal/paypal-server-sdk ^1.0+ in PayPalController.php. The new SDK uses a Builder pattern for requests and dedicated Controllers for API calls, based on OAuth2 Client Credentials.
Changes
- Composer: Removed
paypal/paypal-checkout-sdk; retained/updatedpaypal/paypal-server-sdk. - Imports: Replaced old classes (PayPalHttpClient, OrdersCreateRequest, etc.) with new (PaypalServerSdkClientBuilder, OrderRequestBuilder, OrdersController, etc.).
- Constructor: Updated to use
PaypalServerSdkClientBuilderwithClientCredentialsAuthCredentialsBuilderand Environment (Sandbox/Production based on config/services.php). - createOrder: Now uses
OrdersController->createOrderwithOrderRequestBuilderfor intent, purchase units (AmountWithBreakdownBuilder), custom_id, and application_context. - captureOrder: Now uses
OrdersController->captureOrder; extracts custom_id from response->result->purchaseUnits for DB creation (PackagePurchase/TenantPackage). - createSubscription: Now uses
SubscriptionsController->createSubscriptionwithSubscriptionRequestBuilderfor plan_id, subscriber (NameBuilder), custom_id, and application_context. - Tests: Updated tests/Feature/PurchaseTest.php to mock new SDK classes (e.g., OrdersController, SubscriptionsController) and responses; preserved test logic for flows, errors, idempotency.
- Documentation: Updated docs/prp/08-billing.md to reflect new SDK usage, flow, and migration notes.
Testing
- Unit/Feature Tests: All PayPal-related tests pass with mocks simulating new API responses (statusCode 201, result structure).
- Integration: Verified with Sandbox keys; simulated orders/subscriptions create DB entries correctly; error handling intact.
- No Breaking Changes: Existing webhook logic and completePurchase calls unaffected; custom_id metadata preserved.
Rationale
The old SDK is deprecated and not recommended by PayPal. The new v1 Server SDK aligns with modern standards, improves security (OAuth2), and supports future features. Migration maintains backward compatibility for frontend and DB logic.