- What is dercoder/omnipay-ecopayz?
- It is a Composer package that adds an Ecopayz gateway driver to the Omnipay payment processing library for PHP. Omnipay gives you a single, consistent API across many payment providers, so you call methods like purchase, completePurchase and refund instead of hand-rolling Ecopayz HTTP calls. The driver is framework-agnostic, so it works in Laravel and in plain PHP projects alike.
- How do I install dercoder/omnipay-ecopayz in a Laravel project?
- Run composer require dercoder/omnipay-ecopayz from your project root; Composer will also pull in the Omnipay core dependency the driver requires. Because it is not a Laravel package, there is no service provider or facade to register and no publishable config. Commit the composer.json and composer.lock changes so your deployments stay reproducible.
- How do I create the Ecopayz gateway inside Laravel?
- Use the Omnipay factory, for example Omnipay\Omnipay::create('Ecopayz') with league/omnipay v3, or GatewayFactory::create('Ecopayz') with older omnipay/common releases. Call initialize() with your credentials, typically sourced from config/services.php and .env. Wrapping the gateway in a small service class or binding it in a service provider keeps your controllers clean and makes the gateway easy to swap in tests.
- Which Laravel and PHP versions does this driver support?
- The driver has no direct Laravel dependency, so compatibility is driven by the PHP constraint in its composer.json and by which Omnipay core version it targets. Check that constraint against your application's PHP version before installing, since Laravel 10, 11 and 12 each pin minimum PHP versions. Running composer why-not league/omnipay quickly shows any conflicts with packages already in your lock file.
- What configuration or credentials does the Ecopayz gateway need?
- Expect to supply your Ecopayz merchant identifiers such as an account or wallet ID, a password or secret, plus currency and a test versus live mode flag. The exact parameter names are defined by the gateway class, so read the driver source or its README before wiring up your config. Keep all secrets in .env and never commit live credentials to the repository.
- How do I make a payment and handle the redirect flow?
- Call $gateway->purchase() with the amount, currency, a unique transactionId and your return and cancel URLs. Check $response->isRedirect() and send the customer onward with $response->redirect() or $response->getRedirectUrl(). When Ecopayz sends the customer back, call completePurchase() with the returned request data and confirm $response->isSuccessful() before fulfilling the order.
- How can I test the Ecopayz driver without hitting the live API?
- Omnipay gateways expose getHttpClient() and setHttpClient(), so you can inject a mock HTTP client that returns canned Ecopayz responses. That lets you assert successful, failed and redirect outcomes in Pest or PHPUnit with no network calls. Add a small number of sandbox integration tests if Ecopayz provides a test environment, and keep them out of your default suite.
- Does the driver support refunds, voids or recurring payments?
- Support depends on which request classes the driver implements and which operations Ecopayz's API exposes. Inspect the gateway class for methods such as refund(), void() or createCard() before you design product features around them. If an operation is missing, you can extend the gateway with your own request class or call the Ecopayz API directly for that case.
- How do I handle Ecopayz callbacks and server notifications in Laravel?
- Expose a POST route for Ecopayz notifications and exclude it from CSRF verification in bootstrap/app.php or VerifyCsrfToken. Do not trust raw query parameters: validate the result through the gateway, using completePurchase() or an acceptNotification() method if the driver provides one, and confirm the amount and currency match the original order. Make the handler idempotent so repeated notifications cannot double-credit a customer.
- Is dercoder/omnipay-ecopayz actively maintained, and what are the alternatives?
- Check the GitHub repository for recent commits, open issues and the Omnipay version constraint it declares. If it targets an old Omnipay major version, you may need to fork it, bump the dependency yourself, or wrap the Ecopayz API in a custom gateway class. Other options include building a thin Ecopayz client directly or using a maintained payment aggregator that already supports Ecopayz.