PHPackages                             asciisd/gate-to-pay - 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. asciisd/gate-to-pay

ActiveLibrary[Payment Processing](/categories/payments)

asciisd/gate-to-pay
===================

Laravel package to integrate with Gate To Pay payment service

v1.0.2(1y ago)023MITPHPPHP ^8.1

Since Apr 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/asciisd/gate-to-pay)[ Packagist](https://packagist.org/packages/asciisd/gate-to-pay)[ RSS](/packages/asciisd-gate-to-pay/feed)WikiDiscussions main Synced 1mo ago

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

Gate To Pay Laravel Package
===========================

[](#gate-to-pay-laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/24162e4ac5373d9fd9e9216fbb08d806424e4e4e72ab228d77142b103dacd023/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617363696973642f676174652d746f2d7061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/gate-to-pay)[![Total Downloads](https://camo.githubusercontent.com/ad0d79350cf04428dbef78c4b6c50cf563d1246be904f944b6b6df43023da13d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617363696973642f676174652d746f2d7061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/gate-to-pay)[![License](https://camo.githubusercontent.com/1b010321cb4ef36dc63f5ccffe2e02b675b22a49b2fa712a66feea488ab456f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f617363696973642f676174652d746f2d7061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asciisd/gate-to-pay)

A Laravel package to integrate with Gate To Pay (GateToPay) payment service, supporting both Trade API and CMS Open API.

Features
--------

[](#features)

- Retrieve a list of cards
- Perform Cash Out transactions with internal OTP handling
- Perform Cash In transactions
- Create customer profiles via CMS Open API
- Handle request signature generation securely
- Log all request/response data for auditing

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

[](#installation)

You can install the package via composer:

```
composer require asciisd/gate-to-pay
```

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

[](#configuration)

Publish the config file with:

```
php artisan vendor:publish --provider="ASCIISD\GateToPay\GateToPayServiceProvider"
```

Then set up your environment variables in `.env`:

```
# Trade API Configuration
GATE_TO_PAY_TRADE_API_KEY=your-trade-api-key
GATE_TO_PAY_TRADE_USERNAME=your-username
GATE_TO_PAY_TRADE_PASSWORD=your-password
GATE_TO_PAY_TRADE_BASE_URL=https://tradetest.gatetopay.com
GATE_TO_PAY_TRADE_CURRENCY=USD

# CMS Open API Configuration
GATE_TO_PAY_CMS_API_KEY=your-cms-api-key
GATE_TO_PAY_CMS_BASE_URL=https://cmsopenapitest.gatetopay.com

```

Migrations
----------

[](#migrations)

This package includes migrations to:

1. Add a `gate_to_pay_customer_id` column to your users table
2. Create a `gate_to_pay_cards` table to store customer card information

To publish the migrations:

```
php artisan vendor:publish --provider="ASCIISD\GateToPay\GateToPayServiceProvider" --tag="migrations"
```

Then run the migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Trade API Operations

[](#trade-api-operations)

The Trade API is used for card-related operations like retrieving cards, deposits, and withdrawals.

#### Get Customer Cards

[](#get-customer-cards)

```
use ASCIISD\GateToPay\Facades\GateToPay;

$cards = GateToPay::getCustomerCards($customerId);
```

#### Card Cash Out (Deposit)

[](#card-cash-out-deposit)

```
use ASCIISD\GateToPay\Facades\GateToPay;

$response = GateToPay::cardCashOut([
    'customerId' => 'customer-id',
    'cardId' => 'card-id',
    'depositAmount' => 100.00,
    'transactionId' => 'unique-transaction-id',
    'cardExpiryDate' => '09/25',
]);
```

#### Card Cash In (Withdrawal)

[](#card-cash-in-withdrawal)

```
use ASCIISD\GateToPay\Facades\GateToPay;

$response = GateToPay::cardCashIn([
    'customerId' => 'customer-id',
    'cardId' => 'card-id',
    'withdrawalAmount' => 100.00,
    'transactionId' => 'unique-transaction-id',
    'cardExpiryDate' => '09/25',
]);
```

### CMS Open API Operations

[](#cms-open-api-operations)

The CMS Open API is used for profile management operations.

#### Create a New Customer Profile

[](#create-a-new-customer-profile)

```
use ASCIISD\GateToPay\Facades\GateToPayCMS;

$response = GateToPayCMS::createNewProfile([
    'gender' => 'M',
    'firstName' => 'John',
    'lastName' => 'Doe',
    'birthDate' => '1990-01-01',
    'nationalNumberOrPassport' => 'AB123456',
    'cardType' => 'VISA',
    'nationality' => 'US',
    'address' => '123 Main St, New York, NY',
    'phoneNumber' => '+1234567890',
    'nameOnCard' => 'JOHN DOE',
    'email' => 'john.doe@example.com'
]);
```

#### Generate a Customer ID

[](#generate-a-customer-id)

```
use ASCIISD\GateToPay\Facades\GateToPayCMS;

$customerId = GateToPayCMS::generateCustomerId();
```

For backward compatibility, you can still use the original GateToPay facade for CMS operations:

```
use ASCIISD\GateToPay\Facades\GateToPay;

// These methods delegate to the CMSApiService internally
$response = GateToPay::createNewProfile([/* ... */]);
$customerId = GateToPay::generateCustomerId();
```

Architecture
------------

[](#architecture)

This package uses a clean architecture with separation of concerns:

1. **ApiClient**: Handles HTTP requests, responses, and logging
2. **GateToPayService**: Manages Trade API business logic
3. **CMSApiService**: Manages CMS API business logic
4. **SignatureService**: Handles secure signature generation

Testing
-------

[](#testing)

This package includes a comprehensive test suite. To run the tests, you need to set up the testing environment first:

1. Copy the phpunit.xml.dist file to phpunit.xml:

```
cp phpunit.xml.dist phpunit.xml
```

2. Update the phpunit.xml file with your test credentials:

```

```

3. Run the tests:

```
composer test
```

Note: The phpunit.xml file is gitignored to prevent committing sensitive credentials to your repository.

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance49

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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 ~1 days

Total

3

Last Release

377d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77636067?v=4)[ASCII SD](/maintainers/asciisd)[@asciisd](https://github.com/asciisd)

---

Top Contributors

[![aemaddin](https://avatars.githubusercontent.com/u/11630742?v=4)](https://github.com/aemaddin "aemaddin (10 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/asciisd-gate-to-pay/health.svg)

```
[![Health](https://phpackages.com/badges/asciisd-gate-to-pay/health.svg)](https://phpackages.com/packages/asciisd-gate-to-pay)
```

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[asciisd/knet

Knet package is provides an expressive, fluent interface to KNet's payment services.

141.1k](/packages/asciisd-knet)

PHPackages © 2026

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