sabitahmadumid/sixcash-laravel
Composer 安装命令:
composer require sabitahmadumid/sixcash-laravel
包简介
Unofficial Laravel SDK wrapper for 6Cash payment gateway script
README 文档
README
SixCash Laravel Package
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
A Laravel package for seamless integration with the SixCash Payment Gateway. This package provides an easy-to-use interface for creating payment orders and verifying transactions.
Features
- 💳 Create Payment Orders: Initiate payments and redirect users to the SixCash payment page.
- ✅ Verify Payments: Verify transaction status using the transaction ID.
- 🛡 Type Safety: Built with TypeScript-like type safety for robust error handling.
- 🚦 Error Handling: Custom exceptions for merchant not found, payment verification failures, and more.
- 🔒 Input Validation: Automatically validates input parameters.
- 📦 Laravel Integration: Fully integrated with Laravel's service container and facades.
Installation
You can install the package via composer:
composer require sabitahmadumid/sixcash-laravel
You can publish the config file with:
php artisan vendor:publish --tag="sixcash-laravel-config"
This is the contents of the published config file:
return [ 'base_url' => env('SIXCASH_BASE_URL', 'https://api.sixcash.com'), 'public_key' => env('SIXCASH_PUBLIC_KEY'), 'secret_key' => env('SIXCASH_SECRET_KEY'), 'merchant_number' => env('SIXCASH_MERCHANT_NUMBER'), ];
Add the following environment variables to your .env file:
SIXCASH_BASE_URL=https://api.sixcash.com SIXCASH_PUBLIC_KEY=your_public_key SIXCASH_SECRET_KEY=your_secret_key SIXCASH_MERCHANT_NUMBER=your_merchant_number
Usage
Initialize the Package
The package is automatically registered via the service provider. You can start using it immediately.
Create a Payment Order
use SabitAhmad\SixCash\Facades\SixCash; try { $amount = 100.50; // Payment amount $callbackUrl = route('payment.callback'); // Callback URL after payment $redirectUrl = SixCash::createPaymentOrder($amount, $callbackUrl); // Redirect the user to the payment page return redirect()->away($redirectUrl); } catch (\SabitAhmad\SixCash\Exceptions\MerchantNotFoundException $e) { return back()->withErrors(['error' => 'Merchant not found']); } catch (\Exception $e) { return back()->withErrors(['error' => $e->getMessage()]); }
Verify Payment
use SabitAhmad\SixCash\Facades\SixCash; try { $transactionId = request('transaction_id'); // Get transaction ID from request $payment = SixCash::verifyPayment($transactionId); if ($payment['is_paid']) { // Handle successful payment return response()->json(['message' => 'Payment successful']); } else { // Handle pending or failed payment return response()->json(['message' => 'Payment not completed']); } } catch (\SabitAhmad\SixCash\Exceptions\PaymentVerificationException $e) { return response()->json(['error' => $e->getMessage()], 422); }
Payment Record Structure
[ 'id' => 'string', // Payment ID 'merchant_id' => 'int', // Merchant ID 'user_id' => 'int', // User ID 'transaction_id' => 'string', // Transaction ID 'amount' => 'float', // Payment amount 'is_paid' => 'bool', // Payment status 'expires_at' => 'Carbon', // Expiration date 'created_at' => 'Carbon' // Creation date ]
Error Handling
try { $redirectUrl = SixCash::createPaymentOrder(100, route('payment.callback')); } catch (\SabitAhmad\SixCash\Exceptions\MerchantNotFoundException $e) { // Handle merchant not found } catch (\SabitAhmad\SixCash\Exceptions\PaymentVerificationException $e) { // Handle verification failure } catch (\Exception $e) { // Handle other errors }
Testing
To run the tests, use the following command:
composer test
Support
For any issues, feature requests, or development assistance, feel free to contact me on Discord: Username: xcal_ibur
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
sabitahmadumid/sixcash-laravel 适用场景与选型建议
sabitahmadumid/sixcash-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 02 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「SabitAhmad」 「sixcash-laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sabitahmadumid/sixcash-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sabitahmadumid/sixcash-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sabitahmadumid/sixcash-laravel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Unofficial Bkash Package for Laravel providing seamless integration with Bkash payment gateway.
Laravel package for SteadFast Courier API integration with order creation, tracking, returns, and optional bulk processing
Laravel Installation and Update Wizard Package - Ship your Laravel web app easily with automated installation and update wizards
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-01