- 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.
28 lines
993 B
PHP
28 lines
993 B
PHP
<?php
|
|
|
|
namespace App\Services\PayPal;
|
|
|
|
use PaypalServerSdkLib\PaypalServerSdkClient;
|
|
use PaypalServerSdkLib\PaypalServerSdkClientBuilder;
|
|
use PaypalServerSdkLib\Authentication\ClientCredentialsAuthCredentialsBuilder;
|
|
use PaypalServerSdkLib\Environment;
|
|
|
|
class PaypalClientFactory
|
|
{
|
|
public function make(?bool $sandbox = null, ?string $clientId = null, ?string $clientSecret = null): PaypalServerSdkClient
|
|
{
|
|
$clientId = $clientId ?? config('services.paypal.client_id');
|
|
$clientSecret = $clientSecret ?? config('services.paypal.secret');
|
|
$isSandbox = $sandbox ?? config('services.paypal.sandbox', true);
|
|
|
|
$environment = $isSandbox ? Environment::SANDBOX : Environment::PRODUCTION;
|
|
|
|
return PaypalServerSdkClientBuilder::init()
|
|
->clientCredentialsAuthCredentials(
|
|
ClientCredentialsAuthCredentialsBuilder::init($clientId, $clientSecret)
|
|
)
|
|
->environment($environment)
|
|
->build();
|
|
}
|
|
}
|