Download the PHP package jeddsaliba/laravel-apcopay without Composer

On this page you can find all versions of the php package jeddsaliba/laravel-apcopay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-apcopay

Laravel ApcoPay

Laravel integration for the ApcoPay payment gateway: hosted payment page and payment status (GetPayment / PreparePayment).

Requirements

Installation

Publish the config file (optional; defaults are used from the package):

Configuration

Add to your .env:

APCO_PAY_ENV accepts (case-insensitively) production, prod, or live for the live gateway, and local, sandbox, staging, or testing for the sandbox gateway. Any other value throws a RuntimeException at resolution time rather than silently falling back to the sandbox — this is deliberate, since a typo here would otherwise route real transactions to the wrong endpoint without any warning.

username, password, and pid are required. If any are left blank, resolving the service throws a RuntimeException naming the missing config key(s) instead of failing later with an opaque authentication error from ApcoPay.

After publishing the config, you can optionally customize http (e.g. timeout, connect_timeout) for the Guzzle client. Avoid setting verify => false in production — this disables TLS certificate verification for requests that carry your ApcoPay credentials in plaintext.

Retry / backoff configuration

getPaymentWithRetry() blocks synchronously between attempts using an exponential backoff (base_delay_seconds * backoff_multiplier ^ attempt, capped at max_delay_seconds). Configure it via .env or config/apcopay.php:

Because the delay is a real, blocking sleep(), avoid calling getPaymentWithRetry() directly inside a web request with a large retry count — prefer dispatching a queued job that polls instead, so you don't tie up an application worker or risk a load-balancer timeout.

Usage

Inject Jeddsaliba\ApcoPay\Contracts\ApcoPayServiceInterface:

Exceptions: the service throws Jeddsaliba\ApcoPay\Exceptions\ApcoPayException when the HTTP request to ApcoPay fails, when ApcoPay returns a response that isn't valid JSON, and when getPaymentWithRetry() exhausts all retry attempts. It throws \InvalidArgumentException for invalid input (a non-positive $amount, or $retries < 1).

Each request sent to ApcoPay includes a freshly generated MessageId (a UUID) so that retried or duplicated requests can be deduplicated/reconciled on ApcoPay's side.

Note: this package only wraps ApcoPay's synchronous PreparePayment/GetPayment calls. It does not implement or verify any asynchronous payment notification/webhook ApcoPay may send; if your integration relies on that, you'll need to build and secure that endpoint yourself (verify the request against ApcoPay's documented signing/authentication mechanism before trusting it).

Using the Facade

When the package is installed in a Laravel app, you can use the ApcoPay facade:

Testing

Or with PHPUnit directly:

License

The MIT License (MIT). Please see the License File for more information.


All versions of laravel-apcopay with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jeddsaliba/laravel-apcopay contains the following files

Loading the files please wait ...