PHPackages                             pwparsons/paygate - 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. pwparsons/paygate

AbandonedArchivedLibrary[Payment Processing](/categories/payments)

pwparsons/paygate
=================

A Laravel package to integrate PayGate's PayWeb3 API.

2.2.0(5y ago)36205MITPHPPHP ^7.4

Since Sep 10Pushed 5y agoCompare

[ Source](https://github.com/PWParsons/paygate)[ Packagist](https://packagist.org/packages/pwparsons/paygate)[ Docs](https://github.com/pwparsons/paygate)[ RSS](/packages/pwparsons-paygate/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (7)Versions (11)Used By (0)

WARNING: This repository is no longer maintained ⚠️
===================================================

[](#warning-this-repository-is-no-longer-maintained-warning)

> This repository will not be updated. The repository will be kept available in read-only mode.

[![](https://repository-images.githubusercontent.com/203629326/d9fb0480-add4-11ea-91ec-99a6638a9496)](https://repository-images.githubusercontent.com/203629326/d9fb0480-add4-11ea-91ec-99a6638a9496)

[![Latest Version](https://camo.githubusercontent.com/89e5b425bba8a6bcfa60717249bd073dea7ae107e22637102180eb7d61cb2ad4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7077706172736f6e732f706179676174652e737667)](https://github.com/pwparsons/paygate/releases)[![Tests](https://github.com/PWParsons/paygate/workflows/Tests/badge.svg)](https://github.com/PWParsons/paygate/workflows/Tests/badge.svg)[![Psalm](https://github.com/PWParsons/paygate/workflows/Psalm/badge.svg)](https://github.com/PWParsons/paygate/workflows/Psalm/badge.svg)[![Code Style](https://github.com/PWParsons/paygate/workflows/Code%20Style/badge.svg)](https://github.com/PWParsons/paygate/workflows/Code%20Style/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/ceb84874d28bf1e99997e075eb643471cc06c553d99e91ad1e8290f603b6e9a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7077706172736f6e732f706179676174652e737667)](https://packagist.org/pwparsons/paygate)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)

This package provides an easy way to integrate PayGate's PayWeb3 API with Laravel.

The official documentation can be found [here](http://docs.paygate.co.za/#payweb-3).

Compatibility Chart
-------------------

[](#compatibility-chart)

Package VersionLaravelPHP**2.0.0**7.15+7.4+1.3.25.6 – 6.x7.1+Installation
------------

[](#installation)

You can install this package via composer using:

```
composer require pwparsons/paygate
```

The package will automatically register itself.

To publish the config file to `config/paygate.php` run:

```
php artisan vendor:publish --tag=paygate.config
```

Usage
-----

[](#usage)

After you've installed the package and filled in the values in the config file working with this package will be a breeze. All the following examples use the facade.

### Creating a transaction

[](#creating-a-transaction)

```
// Initiate transaction
$http = PayGate::initiate()
               ->withReference('pgtest_123456789')
               ->withAmount(32.99)
               ->withEmail('email@example.com')
               ->withCurrency('USD') // Optional: defaults to ZAR
               ->withCountry('USA') // Optional: defaults to ZAF
               ->withLocale('en-us') // Optional: defaults to 'en'
               ->withReturnUrl('https://website.com/return_url')
               ->withNotifyUrl('https://website.com/notify_url') // Optional
               ->create();

if ($http->fails()) {
    dump($http->getErrorCode());
    dump($http->getErrorMessage());
    dump($http->all());
}

// Redirect to PayGate's payment page
return PayGate::redirect();
```

An example of the initiate response can be found in the [documentation](http://docs.paygate.co.za/#response).

### Querying a transaction

[](#querying-a-transaction)

```
$http = PayGate::query()
               ->withPayRequestId('YOUR_PAY_REQUEST_ID_HERE')
               ->withReference('pgtest_123456789')
               ->create();

if ($http->fails()) {
    dump($http->getErrorCode());
    dump($http->getErrorMessage());
    dump($http->all());
}

dd($http->all());
```

An example of the query response can be found in the [documentation](http://docs.paygate.co.za/#response-2).

### Tip

[](#tip)

Paygate will post to the RETURN\_URL and NOTIFY\_URL. Exclude these URI's from CSRF verification by adding them to the VerifyCsrfToken middleware. E.g.

```
class VerifyCsrfToken extends Middleware
{
    protected $except = [
        'return_url',
        'notify_url',
    ];
}
```

### Helpful Methods

[](#helpful-methods)

The `with` magic method allows you to set a string after the word 'with' provided within the object it is being called on. This works in exactly the same way as the magic getter except it sets field values and returns the object so that you can chain setters, for example:

```
$object->withReference('pgtest_123456789')
       ->withAmount(32.99)
       ->withEmail('email@example.com')
       ->withReturnUrl('https://my.return.url/page');
```

Will result in the following:

```
{
    "REFERENCE": "pgtest_123456789",
    "AMOUNT": "3299",
    "EMAIL": "email@example.com",
    "RETURN_URL": "https://my.return.url/page"
}
```

The `get` magic method allows you to call any string after the word 'get' and it will return that value, for example:

```
{
    "PAYGATE_ID": "10011072130",
    "PAY_REQUEST_ID": "23B785AE-C96C-32AF-4879-D2C9363DB6E8",
    "REFERENCE": "pgtest_123456789"
}
```

Getting data from the object:

```
echo $object->getPaygateId();       // 10011072130
echo $object->getPayRequestId();    // 23B785AE-C96C-32AF-4879-D2C9363DB6E8
echo $object->getReference();       // pgtest_123456789
```

Change log
----------

[](#change-log)

Please see the [changelog](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](CONTRIBUTING.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Peter Parsons](https://github.com/pwparsons)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see the [license file](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% 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 ~46 days

Recently: every ~34 days

Total

10

Last Release

2073d ago

Major Versions

1.3.2 → 2.0.02020-06-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/16d3d8f75eb3667923efa64037a4285ac167fb0b940e30fbe1574f17ebf9886e?d=identicon)[PWParsons](/maintainers/PWParsons)

---

Top Contributors

[![PWParsons](https://avatars.githubusercontent.com/u/31288220?v=4)](https://github.com/PWParsons "PWParsons (61 commits)")[![zpwparsons](https://avatars.githubusercontent.com/u/102785627?v=4)](https://github.com/zpwparsons "zpwparsons (51 commits)")

---

Tags

laravelpaygate

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pwparsons-paygate/health.svg)

```
[![Health](https://phpackages.com/badges/pwparsons-paygate/health.svg)](https://phpackages.com/packages/pwparsons-paygate)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4851.0k](/packages/sebdesign-laravel-viva-payments)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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