Pros:
HttpClient facade can be extended to wrap the SDK’s SumUpHttpClientInterface for consistency.Checkouts, Customers, Transactions), aligning with Laravel’s Eloquent/Service Layer patterns. Each service can be injected into Laravel controllers/repositories.Auth or Sanctum systems for reuse.Custom service allows extending the SDK for undocumented APIs, useful for future-proofing integrations.SumUpAuthenticationException, SumUpResponseException) map cleanly to Laravel’s exception handling (e.g., throw_if in controllers).Cons:
sumup-php. Migration to the newer SDK should be planned post-PoC.High: The SDK’s simplicity and Laravel’s flexibility enable low-effort integration. Key touchpoints:
$this->app->bind(\SumUp\SumUp::class, function ($app) {
return new \SumUp\SumUp([
'app_id' => config('services.sumup.app_id'),
'app_secret' => config('services.sumup.app_secret'),
// ... other config
]);
});
HttpClient for consistency:
$client = new \SumUp\HttpClients\GuzzleHttpClient(
new \GuzzleHttp\Client(),
config('services.sumup.ca_bundle_path')
);
.env and validate via config/services.php.Customization: Extend the SDK’s Custom service or create Laravel-specific decorators to add features like:
Low to Medium:
Auth system can mitigate this.sumup-php post-PoC.render() in App\Exceptions\Handler).Mitigation:
Http tests to mock the SDK’s HTTP client.log channel or a third-party tool (e.g., Sentry).Custom service?encrypt()) be used?sumup-php? What are the breaking changes?.env and config/ for SDK credentials.Route::post('/sumup/webhook', [SumupWebhookController::class, 'handle'])).SumupPaymentJob).SumupPaymentSucceeded).Mockery to test SDK interactions.SumupPaymentFactory for seeding test data.app/Modules/Sumup).Http tests to mock the SDK.sumup-php SDK.sumup-ecom-php-sdk with the new SDK in Laravel’s codebase.curl or guzzlehttp/guzzle (Laravel’s HttpClient uses Guzzle by default).payments table.migrations to track SumUp webhook events.composer require sumup/sumup-ecom-php-sdk.config/services.php:
'sumup' => [
'app_id' => env('SUMUP_APP_ID'),
'app_secret' => env('SUMUP_APP_SECRET'),
'ca_bundle_path' => storage_path('certs/company-ca.pem'),
'scopes' => ['payments', 'transactions.history'],
],
SumupService facade/class to wrap SDK functionality:
class SumupService {
public function __construct(private \SumUp\SumUp $sumup) {}
public function createCheckout(float $amount, string $currency, string $reference) {
return $this->sumup->getCheckoutService()->create($amount, $currency, $reference, config('services.sumup.merchant_code'));
}
}
AppServiceProvider.SumupWebhookController to handle SumUp’s POST requests.signature header).How can I help you explore Laravel packages today?