PHPackages                             bornmt/laravel-apcopay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. bornmt/laravel-apcopay

ActiveLibrary[Payment Processing](/categories/payments)

bornmt/laravel-apcopay
======================

Laravel integration for ApcoPay payment gateway (hosted page and payment status)

2.0.0(4mo ago)0111MITPHPPHP ^8.2

Since Feb 5Pushed 4mo agoCompare

[ Source](https://github.com/Born-MT/laravel-apcopay)[ Packagist](https://packagist.org/packages/bornmt/laravel-apcopay)[ RSS](/packages/bornmt-laravel-apcopay/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

Laravel ApcoPay
===============

[](#laravel-apcopay)

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

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10.x, 11.x or 12.x
- GuzzleHTTP 7.x

Installation
------------

[](#installation)

```
composer require bornmt/laravel-apcopay
```

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

```
php artisan vendor:publish --tag=apcopay-config
```

Configuration
-------------

[](#configuration)

Add to your `.env`:

```
APCO_PAY_ENV=local
APCO_PAY_USERNAME=
APCO_PAY_PASSWORD=
APCO_PAY_PID=
APCOPAY_BASE_URL=https://www.apsp.biz/GPG/RESTAPI/api/OnlinePayments
APCOPAY_SANDBOX_BASE_URL=https://www.apsp.biz/GPGTest/RESTAPI/api/OnlinePayments
```

Set `APCO_PAY_ENV=production` for live payments.

After publishing the config, you can optionally customize `http` (e.g. `timeout`, `connect_timeout`) for the Guzzle client.

Usage
-----

[](#usage)

Inject `BornMT\ApcoPay\Contracts\ApcoPayServiceInterface`:

```
use BornMT\ApcoPay\Contracts\ApcoPayServiceInterface;
use BornMT\ApcoPay\Enums\PaymentStateFields;

// Get hosted page URL for redirect
$response = $apcoPay->getHostedPage(
    sessionReference: $sessionReference,
    amount: $amount,
    returnUrl: $returnUrl
);
$paymentUrl = $response['paymentURLField'];

// Get payment status
$payment = $apcoPay->getPayment($sessionReference);

// Get payment with retries (e.g. while processing)
$payment = $apcoPay->getPaymentWithRetry($sessionReference, 3);

// Check state
PaymentStateFields::PENDING->value;   // 1
PaymentStateFields::CANCELLED->value; // 2
PaymentStateFields::SUCCESS->value;   // 3
PaymentStateFields::FAILED->value;    // 4
```

Exceptions: the service throws `BornMT\ApcoPay\Exceptions\ApcoPayException` on API or retry failures.

### Using the Facade

[](#using-the-facade)

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

```
use BornMT\ApcoPay\Facades\ApcoPay;

$response = ApcoPay::getHostedPage($sessionReference, $amount, $returnUrl);
$payment = ApcoPay::getPayment($sessionReference);
$payment = ApcoPay::getPaymentWithRetry($sessionReference, 3); // with retries
```

Testing
-------

[](#testing)

```
composer test
```

Or with PHPUnit directly:

```
./vendor/bin/phpunit
```

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance76

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

2

Last Release

133d ago

Major Versions

1.0.0 → 2.0.02026-02-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed7d63f287f3876715c56f44853257d0d6fa6738a889f62884a1e3515c87aacd?d=identicon)[jeddsaliba-webeelabs](/maintainers/jeddsaliba-webeelabs)

![](https://www.gravatar.com/avatar/26da80e3517c5bc5e8517e105f42441b5b51c0395f6d708c2ead39d6ecdd4b08?d=identicon)[bornmt-dev](/maintainers/bornmt-dev)

---

Top Contributors

[![jeddsaliba-webeelabs](https://avatars.githubusercontent.com/u/234561695?v=4)](https://github.com/jeddsaliba-webeelabs "jeddsaliba-webeelabs (6 commits)")

---

Tags

laravelpaymentgatewayapcopay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bornmt-laravel-apcopay/health.svg)

```
[![Health](https://phpackages.com/badges/bornmt-laravel-apcopay/health.svg)](https://phpackages.com/packages/bornmt-laravel-apcopay)
```

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4849.3k](/packages/sebdesign-laravel-viva-payments)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
