PHPackages                             rublex/laravel-core-gateway - 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. rublex/laravel-core-gateway

ActiveLibrary[Payment Processing](/categories/payments)

rublex/laravel-core-gateway
===========================

Vendor-agnostic core contracts and data objects for payment gateway integrations

1.0.0(2mo ago)0211↓33.3%MITPHPPHP &gt;=8.1

Since Apr 9Pushed 2mo agoCompare

[ Source](https://github.com/rublexgit/laravel-core-gateway)[ Packagist](https://packagist.org/packages/rublex/laravel-core-gateway)[ RSS](/packages/rublex-laravel-core-gateway/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Core Gateway
====================

[](#laravel-core-gateway)

[![Latest Version](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)](https://packagist.org/packages/rublex/laravel-core-gateway)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

Vendor-agnostic abstractions for building fiat and crypto gateway integrations with a single reusable contract layer.

Purpose
-------

[](#purpose)

- Shared contracts and capabilities for gateway services.
- Immutable data objects for request and response exchange.
- Generic validation and exception primitives.
- No provider-specific business logic.

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

[](#installation)

```
composer require rublex/laravel-core-gateway
```

Contracts Overview
------------------

[](#contracts-overview)

### Common

[](#common)

- `Rublex\CoreGateway\Contracts\Common\GatewayInterface`
    - `code(): string`
    - `type(): GatewayType`

### Payment capabilities

[](#payment-capabilities)

- `Rublex\CoreGateway\Contracts\Payment\InitiatesPaymentInterface`
- `Rublex\CoreGateway\Contracts\Payment\VerifiesPaymentInterface`
- `Rublex\CoreGateway\Contracts\Payment\QueriesPaymentStatusInterface` (optional)
- `Rublex\CoreGateway\Contracts\Payment\HandlesCallbackInterface` (optional)

Use only the capabilities supported by a specific provider package.

Dynamic Meta Usage
------------------

[](#dynamic-meta-usage)

`DynamicDataBag` stores extensible payload fields without adding provider-specific fields to core DTOs.

```
use Rublex\CoreGateway\Data\DynamicDataBag;

$meta = new DynamicDataBag([
    'customer' => [
        'email' => 'customer@example.com',
    ],
    'provider' => [
        'channel' => 'card',
    ],
]);

$email = $meta->requireString('customer.email');
$meta2 = $meta->with('provider.traceId', 'trace-123');
```

Fiat/Crypto Readiness
---------------------

[](#fiatcrypto-readiness)

- Gateway category is declared via `GatewayType` (`FIAT` or `CRYPTO`).
- Lifecycle result state is standardized via `PaymentStatus`.
- Provider-specific fields remain in `meta`/`raw` bags, so crypto providers can reuse the same DTOs.

Example Implementation
----------------------

[](#example-implementation)

```
use Rublex\CoreGateway\Contracts\Common\GatewayInterface;
use Rublex\CoreGateway\Contracts\Payment\InitiatesPaymentInterface;
use Rublex\CoreGateway\Data\PaymentInitResultData;
use Rublex\CoreGateway\Data\PaymentRequestData;
use Rublex\CoreGateway\Enums\GatewayType;
use Rublex\CoreGateway\Enums\PaymentStatus;

final class ExampleGateway implements GatewayInterface, InitiatesPaymentInterface
{
    public function code(): string
    {
        return 'example';
    }

    public function type(): GatewayType
    {
        return GatewayType::FIAT;
    }

    public function initiate(PaymentRequestData $request): PaymentInitResultData
    {
        // map provider response into the core result shape
        return new PaymentInitResultData(PaymentStatus::PENDING);
    }
}
```

Migration Notes
---------------

[](#migration-notes)

- Previous releases exposed only package metadata.
- `v1.0.0` now includes reusable contracts, enums, exceptions, and DTOs for all gateway packages.
- Existing provider packages can keep their public methods and map them to the new contract methods internally.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance85

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

79d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a30955dfb5812ce62591802375eae1fe89123b20ae34bbed85aa29701f919ae4?d=identicon)[rublex](/maintainers/rublex)

---

Tags

laravelcorepaymentgatewayrublex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rublex-laravel-core-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/rublex-laravel-core-gateway/health.svg)](https://phpackages.com/packages/rublex-laravel-core-gateway)
```

###  Alternatives

[evryn/laravel-toman

A simple stable Laravel package to handle popular payment gateways in Iran including ZarinPal and IDPay.

10710.2k](/packages/evryn-laravel-toman)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

312.4k1](/packages/dena-a-iran-payment)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)

PHPackages © 2026

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