Payment orchestration shouldn't require writing raw HTTP requests. Spreedly PHP brings a Stripe-like developer experience to the Spreedly platform — complete with gateway management, card tokenization, and full Laravel integration.
Why Spreedly?
If your app processes payments through a single gateway, you probably don't need Spreedly. But the moment you need to:
- Support multiple payment gateways (Stripe, Braintree, Adyen, etc.)
- Fail over between gateways automatically
- Route transactions based on currency, region, or card type
- Avoid vendor lock-in on your payment infrastructure
That's when Spreedly becomes essential. It sits between your app and your payment gateways, providing a single unified API.
The Problem with Existing SDKs
Spreedly's official API is well-documented, but there was no production-quality PHP SDK. Teams were stuck writing their own HTTP clients, handling XML responses, managing authentication, and implementing retry logic from scratch.
Spreedly PHP changes that.
Stripe-Like Architecture
If you've used the Stripe PHP SDK, Spreedly PHP will feel immediately familiar:
use Laratusk\Spreedly\Facades\Spreedly;
// Create a gateway
$gateway = Spreedly::gateway()->create([
'gateway_type' => 'stripe',
'credentials' => [
'login' => $stripeSecretKey,
],
]);
// Tokenize a payment method
$paymentMethod = Spreedly::paymentMethod()->create([
'credit_card' => [
'number' => '4111111111111111',
'month' => '12',
'year' => '2027',
],
]);
// Process a transaction
$transaction = Spreedly::transaction()->purchase([
'gateway_token' => $gateway->token,
'payment_method_token' => $paymentMethod->token,
'amount' => 5000, // $50.00
'currency_code' => 'USD',
]);SCA and 3D Secure Support
Strong Customer Authentication (SCA) is required in the EU and increasingly expected elsewhere. Spreedly PHP handles the full 3DS flow:
$transaction = Spreedly::transaction()->purchase([
'gateway_token' => $gateway->token,
'payment_method_token' => $token,
'amount' => 10000,
'currency_code' => 'EUR',
'three_ds' => true,
'callback_url' => route('payment.3ds.callback'),
]);
if ($transaction->isPending3ds()) {
return redirect($transaction->threeDsRedirectUrl());
}Full Laravel Integration
- Service provider with auto-discovery
- Facade for clean, expressive code
- Config publishing for environment-based credentials
- Webhook handling with signature verification
composer require laratusk/spreedly
php artisan vendor:publish --tag=spreedly-configBattle-Tested
Spreedly PHP was built for production from day one. It includes comprehensive error handling, automatic retries for transient failures, and detailed logging for debugging payment issues.
Explore the full documentation on GitHub.