- How do I install ekipower/payum-nganluong in a Laravel project?
- Run `composer require ekipower/payum-nganluong` and ensure Payum (v2) is installed. Configure the NganLuong gateway in your Payum service provider by registering the factory and setting API credentials. Laravel’s service container will auto-resolve dependencies if Payum is properly bootstrapped.
- What Laravel versions does this package support?
- This package works with Laravel 5.5+ but relies on Payum v2, which lacks PSR-15 middleware support. For Laravel 8+, use Payum v3+ (via `payum/payum-bundle`) for better compatibility. Test thoroughly if using older Laravel versions.
- Can I use this package alongside other Payum gateways?
- Yes, the package integrates with Payum’s gateway-agnostic architecture. You can configure multiple gateways (e.g., Stripe, PayPal) in the same Laravel app, switching between them via Payum’s factory or service container bindings.
- How do I handle NganLuong’s redirect-based checkout flow?
- Use Payum’s `capture` action to initiate the payment, which generates a redirect URL. After the user returns, NganLuong sends a callback to your `notify` endpoint. Configure return URLs in Payum’s gateway settings and validate the callback signature for security.
- Why is this package deprecated, and should I migrate to ekipower/nganluong?
- The package is deprecated in favor of `ekipower/nganluong`, which may offer Laravel-specific optimizations, bug fixes, or Payum v3 support. Check the successor’s README for Laravel 10 compatibility and critical feature parity before migrating.
- How do I test payment callbacks locally?
- Mock NganLuong’s API responses using Payum’s test utilities or Laravel’s HTTP testing tools. Stub the `notify` endpoint to simulate callbacks, then assert transaction statuses. For redirect flows, use Laravel’s `actingAs` or browser testing tools.
- Does this package support webhooks for asynchronous notifications?
- No, this package assumes synchronous callbacks via NganLuong’s `notify` endpoint. For async webhooks, extend Payum’s event system or use Laravel’s queue workers to process delayed responses from NganLuong’s API.
- What happens if NganLuong’s API fails during a transaction?
- Payum will throw exceptions (e.g., `PayumException`) that you can catch in Laravel middleware or controllers. Log errors with Monolog or Sentry, and implement retries or fallback gateways. Custom exception handlers may be needed for NganLuong-specific failures.
- Can I use this with Laravel Cashier or other payment services?
- No, this package is Payum-specific. For Cashier integration, you’d need to wrap Payum in a custom Cashier driver, which requires significant effort. Alternatively, use Payum standalone for multi-gateway support without Cashier.
- Are there alternatives to this package for NganLuong payments in Laravel?
- The successor `ekipower/nganluong` is the recommended alternative. For other options, consider building a custom Payum gateway or using a Laravel-specific package like `spatie/payment-providers` (if NganLuong is added). Direct API integration is also possible but lacks Payum’s abstraction.