asciisd/cybersource-hosted-checkout-laravel
Laravel integration for CyberSource Secure Acceptance Hosted Checkout. Includes a Blade component (and optional Vue component) to render the hosted payment form, plus configurable credentials via config/env for a fluent checkout setup.
payment.succeeded, payment.failed). This fits architectures leveraging queues/jobs for async processing..env), aligning with 12-factor app principles and multi-environment deployments (dev/stage/prod).| Risk Area | Severity | Mitigation |
|---|---|---|
| Cybersource API Deprecation | High | Monitor Cybersource’s API changelog and fork if needed. |
| Webhook Reliability | Medium | Implement idempotency checks and retry logic for failed callbacks. |
| Tokenization Security | Critical | Ensure .env secrets are never committed and use Laravel’s Vault if available. |
| Laravel Version Support | Low | Test against Laravel 10/11 (package claims compatibility; verify in CI). |
| Custom Fields | Medium | Extend the package via traits or mixins for non-standard Cybersource fields. |
payment.failed) trigger business workflows (e.g., inventory holds, notifications)?payments table.database or redis driver).laravel-cache package).composer require asciisd/cybersource-hosted-checkout-laravel..env:
CYBERSOURCE_MERCHANT_ID=your_merchant_id
CYBERSOURCE_API_KEY=your_api_key
CYBERSOURCE_API_SECRET=your_secret
CYBERSOURCE_ENV=sandbox # or 'production'
php artisan vendor:publish --tag=cybersource-config.$token = Cybersource::token()->create([
'amount' => 100.00,
'currency' => 'USD',
'orderId' => 'order_123',
'customer' => ['id' => 'user_456']
]);
<iframe src="{{ $token->getHostedCheckoutUrl() }}"></iframe>
Route::post('/cybersource/webhook', [PaymentWebhookController::class, 'handle']);
Event system or queues:
event(new PaymentSucceeded($payment));
| Step | Dependency | Effort | Owner |
|---|---|---|---|
1. Configure .env |
Cybersource credentials | Low | DevOps/Backend |
| 2. Frontend HPP iframe | Token generation endpoint | Medium | Frontend/Backend |
| 3. Webhook route | Laravel event system or queues | Medium | Backend |
| 4. Event handlers | Business logic (e.g., inventory) | High | Backend |
| 5. Testing | Cybersource sandbox + mocks | High | QA/Backend |
| 6. Monitoring | Logs for webhook failures | Low | DevOps |
composer.json (e.g., ^1.0) to avoid breaking changes.README or wiki.CYBERSOURCE_DEBUG=true
Redis).| Failure Scenario | Impact | Mitigation | |--------------------------------|--------------------------------
How can I help you explore Laravel packages today?