PHPackages                             gcorpllc/paypey - 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. gcorpllc/paypey

ActivePackage

gcorpllc/paypey
===============

The Paypey package is a simple and powerful solution for connecting to various payment gateways in Laravel projects.

v1.0.1(1y ago)01MITPHPPHP &gt;=8.0

Since Apr 20Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/gcorp-llc/paypey)[ Packagist](https://packagist.org/packages/gcorpllc/paypey)[ RSS](/packages/gcorpllc-paypey/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Paypey - Laravel Payment Gateway Package
========================================

[](#paypey---laravel-payment-gateway-package)

English
-------

[](#english)

### Introduction

[](#introduction)

**Paypey** is a Laravel package designed to simplify integration with various Iranian payment gateways. It offers a clean and flexible API to handle payment requests, verifications, and callbacks seamlessly.

### Features

[](#features)

- Supports multiple Iranian payment gateways (e.g., Zarinpal, Mellat, Saman).
- Simple and intuitive API for initiating and verifying transactions.
- Configurable gateway selection.
- Robust error handling.
- Compatible with Laravel 8.x, 9.x, and 10.x.

### Requirements

[](#requirements)

- PHP &gt;= 8.0
- Laravel &gt;= 8.0
- Composer

### Installation

[](#installation)

1. Install via Composer: ```
      composer require gcorpllc/paypey
    ```
2. Publish the configuration file: ```
    php artisan vendor:publish --provider="gcorpllc\Paypey\PaypeyServiceProvider"
    ```

This creates a `config/paypey.php` file.

### Config

[](#config)

Edit the `config/paypey.php` file to set the ports. Example:

```
    'default_gateway' => env('PAYPEY_DEFAULT_GATEWAY', 'zarinpal'),
    'callbackUrl' =>  env('CALLBACK_URL', '/callback'),
    'sandbox' => env('PAYPEY_SANDBOX', true),
    'gateways' => [
        'zarinpal' => [
            'sandbox' => env('ZARINPAL_SANDBOX', false),// can be normal, sandbox, zaringate
            'merchantId' =>  env('ZARINPAL_MERCHANT_ID', 'zarinpal'),
            'description' => 'payment using zarinpal',
            'currency' => env('CURRENCY', 'T'), //Can be R, T (Rial, Toman)
        ],
    ],
```

Add to your `.env` file:

```
PAYPEY_DEFAULT_GATEWAY="zarinpal"
CALLBACK_URL="your-merchant-id"
PAYPEY_SANDBOX=true
```

### Usage

[](#usage)

#### Initiating a Payment

[](#initiating-a-payment)

```
use Gcorpllc\Paypey\Facades\Paypey;

$payment = Paypey::driver('zarinpal')
    ->amount(10000) // Amount in IRR
    ->callbackUrl(route('payment.callback'))
    ->purchase();

if ($payment->isSuccessful()) {
    return redirect($payment->getPaymentUrl());
} else {
    return response()->json(['error' => $payment->getErrorMessage()]);
}
```

#### Verifying a Payment

[](#verifying-a-payment)

```
use Gcorpllc\Paypey\Facades\Paypey;

$result = Paypey::driver('zarinpal')->verify();

if ($result->isSuccessful()) {
    $transactionId = $result->getTransactionId();
    return response()->json(['message' => 'Payment verified!', 'transaction_id' => $transactionId]);
} else {
    return response()->json(['error' => $result->getErrorMessage()]);
}
```

### Supported Gateways

[](#supported-gateways)

- **Zarinpal**: Sandbox and production modes.
- **Mellat**: Secure transactions with terminal ID.
- More gateways to be added soon.

### Error Handling

[](#error-handling)

Access error messages via:

```
$errorMessage = $payment->getErrorMessage();
```

### Testing

[](#testing)

Clone the repository and run:

```
composer install
./vendor/bin/phpunit
```

### License

[](#license)

Licensed under the [MIT License](LICENSE.md).

### Support

[](#support)

For issues, open a ticket on [GitHub](https://github.com/your-vendor/paypey/issues) or email .

---

فارسی
-----

[](#فارسی)

### معرفی

[](#معرفی)

**Paypey** یک پکیج لاراول است که برای ساده‌سازی اتصال به درگاه‌های پرداخت ایرانی طراحی شده است. این پکیج یک API تمیز و انعطاف‌پذیر برای مدیریت درخواست‌های پرداخت، تأیید تراکنش‌ها و callbackها ارائه می‌دهد.

### ویژگی‌ها

[](#ویژگی‌ها)

- پشتیبانی از درگاه‌های پرداخت ایرانی (مانند زرین‌پال، ملت، سامان).
- API ساده و کاربرپسند برای شروع و تأیید تراکنش‌ها.
- امکان انتخاب درگاه پیش‌فرض.
- مدیریت خطاها به‌صورت جامع.
- سازگار با لاراول نسخه‌های 8.x، 9.x و 10.x.

### پیش‌نیازها

[](#پیش‌نیازها)

- PHP نسخه &gt;= 8.0
- لاراول نسخه &gt;= 8.0
- Composer

### نصب

[](#نصب)

1. پکیج را از طریق Composer نصب کنید: ```
       composer require gcorpllc/paypey
    ```
2. فایل پیکربندی را منتشر کنید: ```
    php artisan vendor:publish --provider="Gcorpllc\Paypey\PaypeyServiceProvider"
    ```

    این دستور فایل `config/paypey.php` را ایجاد می‌کند.

### پیکربندی

[](#پیکربندی)

فایل `config/paypey.php` را برای تنظیم درگاه‌ها ویرایش کنید. نمونه:

```
    'default_gateway' => env('PAYPEY_DEFAULT_GATEWAY', 'zarinpal'),
    'callbackUrl' =>  env('CALLBACK_URL', '/callback'),
    'sandbox' => env('PAYPEY_SANDBOX', true),
    'gateways' => [
        'zarinpal' => [
            'sandbox' => env('ZARINPAL_SANDBOX', false),// can be normal, sandbox, zaringate
            'merchantId' =>  env('ZARINPAL_MERCHANT_ID', 'zarinpal'),
            'description' => 'payment using zarinpal',
            'currency' => env('CURRENCY', 'T'), //Can be R, T (Rial, Toman)
        ],
    ],
```

در فایل `.env` موارد زیر را اضافه کنید:

```
PAYPEY_DEFAULT_GATEWAY="zarinpal"
CALLBACK_URL="your-merchant-id"
PAYPEY_SANDBOX=true
```

### استفاده

[](#استفاده)

#### شروع پرداخت

[](#شروع-پرداخت)

```
use Gcorpllc\Paypey\Facades\Paypey;

$payment = Paypey::driver('zarinpal')
    ->amount(10000) // Amount in IRR
    ->callbackUrl(route('payment.callback'))
    ->purchase();

if ($payment->isSuccessful()) {
    return redirect($payment->getPaymentUrl());
} else {
    return response()->json(['error' => $payment->getErrorMessage()]);
}
```

#### تأیید پرداخت

[](#تأیید-پرداخت)

```
use YourVendor\Paypey\Facades\Paypey;

$result = Paypey::driver('zarinpal')->verify();

if ($result->isSuccessful()) {
    $transactionId = $result->getTransactionId();
    return response()->json(['message' => 'پرداخت با موفقیت تأیید شد!', 'transaction_id' => $transactionId]);
} else {
    return response()->json(['error' => $result->getErrorMessage()]);
}
```

### تست

[](#تست)

برای اجرای تست‌ها، مخزن را کلون کرده و دستورات زیر را اجرا کنید:

```
composer install
./vendor/bin/phpunit
```

### لایسنس

[](#لایسنس)

این پکیج تحت [لایسنس MIT](LICENSE.md) منتشر شده است.

### پشتیبانی

[](#پشتیبانی)

برای مشکلات یا سؤالات، یک تیکت در [GitHub](https://github.com/your-vendor/paypey/issues) باز کنید یا به  ایمیل بزنید.

---

### توضیحات

[](#توضیحات)

- **ساختار**: README به دو بخش انگلیسی و فارسی تقسیم شده است تا برای کاربران بین‌المللی و ایرانی قابل استفاده باشد.
- **جایگزینی**: نام `your-vendor` باید با نام واقعی وندور شما جایگزین شود. همچنین، لینک‌های GitHub و اطلاعات تماس باید به‌روزرسانی شوند.
- **شخصی‌سازی**: می‌توانید درگاه‌های خاص یا قابلیت‌های اضافی پکیج خود را در بخش‌های مربوطه اضافه کنید.
- **استاندارد**: این فایل از استانداردهای رایج README (مانند badges، ساختار واضح و مثال‌های کد) پیروی می‌کند.

اگر نیاز به تغییرات خاصی (مانند افزودن بخش‌های جدید یا تغییر لحن) دارید، لطفاً اطلاع دهید!

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance67

Regular maintenance activity

Popularity1

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~0 days

Total

2

Last Release

384d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1edca0ed33b9686001fdf310a608163db2bf6af4016379f811a03da6286af3a9?d=identicon)[GCORP LLC](/maintainers/GCORP%20LLC)

---

Top Contributors

[![gcorp-llc](https://avatars.githubusercontent.com/u/51985898?v=4)](https://github.com/gcorp-llc "gcorp-llc (4 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/gcorpllc-paypey/health.svg)

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

PHPackages © 2026

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