- How do I integrate CyberSource Hosted Checkout into my Laravel app with minimal setup?
- Run `composer require asciisd/cybersource-hosted-checkout-laravel`, publish the config with `php artisan vendor:publish --tag=cybersource-config`, and add your credentials to `.env` (e.g., `CYBERSOURCE_PROFILE_ID`). Use the Blade component `<x-cybersource-checkout>` in your views with `amount`, `currency`, and `reference-number` attributes.
- Does this package support Laravel 10 and 11?
- Yes, the package claims compatibility with Laravel 10 and 11. Always verify by checking the repository’s `composer.json` for supported versions and running tests in your environment. The package leverages Laravel’s Service Container, so updates should align with minor Laravel releases.
- Can I use this package with Vue.js or React?
- The package includes an optional Vue.js component (`CyberSourceCheckout.vue`). Publish assets with `php artisan vendor:publish --tag=cybersource-assets` and register it in your Vue app. For React, use the Blade component or iframe redirection, as the package is frontend-agnostic.
- How do I handle webhook callbacks for payment status updates?
- The package supports webhook callbacks for events like `payment.succeeded` or `payment.failed`. Configure the webhook URL in your Cybersource merchant console and validate HMAC signatures in your Laravel route. Use Laravel’s queue system to process events asynchronously for reliability.
- Is this package PCI-compliant for my e-commerce store?
- Yes, CyberSource Hosted Checkout (HPP) is PCI-compliant, and this package abstracts the payment form into an iframe, reducing your PCI scope. Ensure you never expose API keys in client-side code and use Laravel’s `.env` or Vault for secrets.
- How do I test the package in a sandbox environment?
- Set `CYBERSOURCE_ENV=sandbox` in your `.env` and use Cybersource’s test credentials. Mock API responses in unit tests with tools like VCR or Laravel’s HTTP testing helpers. The package supports tokenization in sandbox mode for seamless testing.
- Can I customize the hosted checkout form fields (e.g., add custom billing fields)?
- The package supports standard billing fields like `address_line1`, `email`, etc. For custom fields, extend the package by overriding the `CybersourceService` or using traits to add non-standard payloads. Check Cybersource’s API docs for supported custom fields.
- What Laravel versions are officially supported?
- The package targets Laravel 8+ and explicitly claims compatibility with Laravel 10 and 11. Always check the `composer.json` for the latest supported versions. Test thoroughly in your environment, especially if using newer Laravel features like model macros or HTTP clients.
- How do I handle refunds or subscriptions with this package?
- This package focuses on Hosted Checkout (HPP) for one-time payments. For refunds or subscriptions, use Cybersource’s native API (v2) or extend the package. The package’s facade can be combined with `guzzlehttp/guzzle` for custom API calls to handle these workflows.
- Are there alternatives to this package for CyberSource in Laravel?
- Alternatives include direct integration with Cybersource’s REST API (v2) using Guzzle or official SDKs, or packages like `spatie/laravel-cybersource`. This package simplifies Hosted Checkout (HPP) with Blade/Vue components, while others may offer broader API coverage. Choose based on your need for PCI compliance (HPP) vs. full API access.