mohammadmehrabani/iran-payment
Composer 安装命令:
composer require mohammadmehrabani/iran-payment
包简介
a Laravel package to handle Internet Payment Gateways for Iran Banking System
关键字:
README 文档
README
IranPayment for Laravel
a Laravel package to handle Internet Payment Gateways (IPGs) for Iran Banking System
Accepting Sadad (Melli), Saman (Sep), Zarinpal and more iranian payment gateways. Just use the IranPayment to receive payments directly on your website.
Gateways
Gateways
| Logo | Gateway | Description | Available | Tested | Last Update |
|---|---|---|---|---|---|
![]() |
Sadad (Melli) | بانک ملی (سداد) | ✓ | ✓ | 2020/09/10 |
![]() |
Saman (Sep) | (سپ) بانک سامان | ✓ | ✓ | 2020/08/03 |
![]() |
Mellat (Behpardakht) | (به پرداخت) بانک ملت | ✓ | ✓ | 2024/08/18 |
![]() |
Pay.ir | پرداخت پی | ✓ | ✓ | 2020/08/03 |
![]() |
Zarinpal | زرین پال | ✓ | ✓ | 2020/08/03 |
![]() |
Payping | پی پینگ | ✓ | ✓ | 2020/08/04 |
![]() |
Novinopay | نوینو پرداخت | ✓ | ✓ | 2022/03/23 |
![]() |
Digipay | دیجی پی | CPG ✓ BPG/BNPL ✓ | ✓ | 2024/06/24 |
| --- | Qeroun | قرون - خرید امن با ایجاد توافقنامه | - | - | - |
| --- | Parsian (Pec) | (پک) بانک پارسیان | - | - | - |
| --- | Pasargad (Pep) | (پپ) بانک پاسارگاد | - | - | - |
| --- | Zibal | زیبال | - | - | - |
| --- | IDPay | آیدی پی | - | - | - |
Requirements
Installation
-
Add the package to your composer file via the
composer requirecommand:$ composer require dena-a/iran-payment:^2.0
Or add it to
composer.jsonmanually:"require": { "dena-a/iran-payment": "^2.0" }
-
IranPayment's service providers will be automatically registered using Laravel's auto-discovery feature.
Note: For Lumen you have to add the IranPayment service provider manually to:
bootstrap/app.php:$app->register( Dena\IranPayment\IranPaymentServiceProvider::class);
-
Publish the config-file and migration with:
php artisan vendor:publish --provider="Dena\IranPayment\IranPaymentServiceProvider" -
After the migration has been published you can create the transactions-tables by running the migrations:
php artisan migrate
Usage
New Payment:
use Dena\IranPayment\IranPayment; // Default gateway $payment = IranPayment::create(); // Select one of available gateways $payment = IranPayment::create('sadad'); // Test gateway (Would not work on production environment) $payment = IranPayment::create('test'); // Or use your own gateway $payment = IranPayment::create(NewGateway::class); $payment->setUserId($user->id) ->setAmount($data['amount']) ->setCallbackUrl(route('bank.callback')) ->ready(); return $payment->redirect();
Verify Payment:
use Dena\IranPayment\IranPayment; use Dena\IranPayment\Exceptions\IranPaymentException; try { $payment = IranPayment::detect()->confirm(); $trackingCode = $payment->getTrackingCode(); $statusText = $payment->getTransactionStatusText(); } catch (Dena\IranPayment\Exceptions\IranPaymentException $ex) { throw $ex; }
Create your own payment gateway class
use Dena\IranPayment\Gateways\AbstractGateway; use Dena\IranPayment\Gateways\GatewayInterface; class NewGateway extends AbstractGateway implements GatewayInterface { public function getName(): string { return 'new-gateway'; } public function initialize(array $parameters = []): self { parent::initialize($parameters); return $this; } public function purchase(): void { // Send Purchase Request $reference_number = 'xxxx'; $this->transactionUpdate([ 'reference_number' => $reference_number, ]); } public function purchaseUri(): string { return 'http://new-gateway.com/token/xxxx'; } public function verify(): void { $this->transactionVerifyPending(); // Send Payment Verify Request $tracking_code = 'yyyy'; $this->transactionSucceed([ 'tracking_code' => $tracking_code ]); } }
Contribute
Contributions are always welcome!
Support
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.
License
The MIT License (MIT). Please see License File for more information.
mohammadmehrabani/iran-payment 适用场景与选型建议
mohammadmehrabani/iran-payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 119 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 08 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「pay」 「gateway」 「laravel」 「Bank」 「merchant」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mohammadmehrabani/iran-payment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mohammadmehrabani/iran-payment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mohammadmehrabani/iran-payment 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Библиотека для приема платежей через Альфабанк.
Some pre-defined rules for validation in Omnipay payment processing library.
BluePay gateway for the Omnipay payment processing library
支付宝接口扩展包
统计信息
- 总下载量: 119
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-18









