chitanga/pesepay
Composer 安装命令:
composer require chitanga/pesepay
包简介
Seamless Pesepay integration package
README 文档
README
Pesepay Payment Gateway for Laravel Latest Version on Packagist GitHub Tests Action Status Total Downloads
A comprehensive Laravel package for integrating Pesepay payment gateway into your application. This package provides seamless Ecocash and card payment processing with robust error handling and status checking.
Features
Ecocash payments integration
Card payments processing
Payment status verification
Comprehensive exception handling
Configurable through environment variables
Installation
You can install the package via composer:
composer require chitanga/pesepay
You can publish with:
php artisan vendor:publish --tag="pesepay-config"
You can publish the config file with:
php artisan vendor:publish --tag=":package_slug-config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | API Credentials |-------------------------------------------------------------------------- */ 'integration_key' => env('PESEPAY_INTEGRATION_KEY'), 'encryption_key' => env('PESEPAY_ENCRYPTION_KEY'), /* |-------------------------------------------------------------------------- | Payment URLs |-------------------------------------------------------------------------- */ 'return_url' => env('PESEPAY_RETURN_URL'), 'result_url' => env('PESEPAY_RESULT_URL'), /* |-------------------------------------------------------------------------- | Default Settings |-------------------------------------------------------------------------- */ 'default_currency' => 'USD', 'brand_name' => env('PESEPAY_BRAND_NAME', env('APP_NAME', 'Laravel')), ];
Configuration Add these environment variables to your .env file:
PESEPAY_INTEGRATION_KEY=your_integration_key
PESEPAY_ENCRYPTION_KEY=your_encryption_key
PESEPAY_RETURN_URL=https://your-app.com/return
PESEPAY_RESULT_URL=https://your-app.com/webhook
PESEPAY_BRAND_NAME="Your Business Name"
Usage
use Chitanga\Pesepay\PesepayService; $pesepay = new PesepayService( config('pesepay.integration_key'), config('pesepay.encryption_key'), config('pesepay.return_url'), config('pesepay.result_url') );
Ecocash Payment
try { $payment = $pesepay->ecocash([ 'amount' => 10.50, 'phone' => '263771234567', 'email' => 'customer@example.com', 'reference' => 'PZW211', // Dont change the reference code 'description' => 'Product purchase' ]); // Store $payment['reference_number'] and $payment['poll_url'] in your database } catch (\Chitanga\Pesepay\Exceptions\PesepayException $e) { // Handle payment error }
Card Payment
try { $payment = $pesepay->card([ 'amount' => 25.00, 'email' => 'customer@example.com', 'card_number' => '4111111111111111', 'card_expiry' => '12/25', 'card_cvv' => '123', 'reference' => 'PWZ204' // Dont change the reference code ]); // Process payment response } catch (\Chitanga\Pesepay\Exceptions\PesepayException $e) { // Handle payment error }
Check Payment Status
// Using the poll_url from the payment response $status = $pesepay->checkPaymentStatus($pollUrl); if ($status['success']) { // Payment was successful } else { // Payment failed or is pending } // Quick check if ($pesepay->isPaymentSuccessful($pollUrl)) { // Payment successful }
Error Handling
The package throws PesepayException for all payment-related errors. You can catch and handle these exceptions:
try {
// Payment operations
} catch (\Chitanga\Pesepay\Exceptions\PesepayException $e) {
// Get error details
$errorMessage = $e->getMessage();
$errorCode = $e->getCode();
$errorData = $e->getData();
// Handle error appropriately
}
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
chitanga/pesepay 适用场景与选型建议
chitanga/pesepay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 04 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ecommerce」 「payment」 「gateway」 「pesepay」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 chitanga/pesepay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 chitanga/pesepay 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 chitanga/pesepay 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Nevogate Payment Gateway SDK
Payyo Gateway for the Omnipay payment processing library
Dealing with payments through the Egyptian payment gateway PayMob
A PHP (and Laravel) package to interface with the Snipcart api.
Client library to send SMS using Comilio SMS Gateway API (https://www.comilio.it)
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-09