leafwrap/payment-deals
Composer 安装命令:
composer require leafwrap/payment-deals
包简介
A Laravel-based online payment gateway solution featuring popular payment gateways like PayPal, Stripe, Razorpay, bKash, and more. Seamlessly integrate secure and diverse payment options into your web applications with ease.
README 文档
README
The Payment Deal Library is a powerful and versatile Laravel package designed to simplify and enhance online payment processing. Whether you're a business owner, developer, or entrepreneur, this library provides you with a comprehensive toolkit for integrating popular payment gateways seamlessly into your web applications.
Key Features:
Gateway Diversity: Payment Deal offers support for an array of popular payment gateways, including PayPal, Stripe, Razorpay, bKash, and more. This versatility allows you to cater to a global audience and adapt to various payment preferences.
Laravel Integration: Built specifically for Laravel, this library integrates effortlessly with Laravel-based projects. It leverages Laravel's elegance and robustness to provide a reliable and consistent payment experience.
Simple Configuration: Payment Deal simplifies the setup process with an intuitive configuration system. With just a few lines of code, you can start accepting payments through your chosen gateway.
Security: Security is a top priority, and Payment Deal incorporates the latest security standards to protect sensitive customer data. It ensures PCI compliance and safeguards your transactions.
Extensive Documentation: The library comes with comprehensive documentation and examples, making it easy for developers of all levels to get started and effectively implement payment gateways within their applications.
Customization: Tailor the payment experience to match your brand by customizing payment forms and user interactions. Payment Deal provides flexibility for design and user experience customization.
Error Handling: Robust error handling mechanisms ensure that you can easily troubleshoot and resolve issues, enhancing the reliability of your payment processing.
Ongoing Updates: The Payment Deal Library is actively maintained, meaning you'll receive updates, bug fixes, and support to keep your payment systems running smoothly.
Requirements:
You should ensure that your web server has the following minimum PHP version and extensions:
- PHP >= 8.0
Installation:
First, install the PaymentDeal package using the Composer package manager:
composer require leafwrap/payment-deals
Database Migrations
PaymentDeal service provider registers its own database migration directory, so remember to migrate your database after installing the package.
php artisan migrate
Configuration
Gateway Credentials or API Keys
PaymentDeal provide payment gateway configuration api to store credentials in database. Please click the below link to show api documentation.
https://documenter.getpostman.com/view/7667667/2s9YBz3b3S
Usages
- Create a payment request
use Leafwrap\PaymentDeals\Facades\PaymentDeal; Route::post('payment', function () { // Fetch your pricing plan $plan = PricingPlan::where(['id' => 1])->first()->toArray(); /* Initialize required value to create a payment request Parameters: 1. Pricing Package // an array 2. Amount // float or int 3. User ID // string 4. Gateway Name // string (ex: paypal, stripe, razorpay, bkash, paystack) 5. Credentials Condition // [tenant_id = 1] 6. Currency // string (ex: USD, INR, BDT) 7. Exchange Rate // float (if currency is not usd) */ PaymentDeal::init($plan, $amount, $userId, $gateway, $credentialCondition, $currency, $exchangeRate); // Pay provides you to request a payment PaymentDeal::checkout(); // Feedback provides you payment url link & payment response return PaymentDeal::getResponse(); });
- Query your payment (Optional)
use Leafwrap\PaymentDeals\Facades\PaymentDeal; Route::post('payment-query', function () { $transactionId = 'TRANS-XXXXXXXXXXXXX' // Query for payment status PaymentDeal::query($transactionId); // Feedback provides you payment response return PaymentDeal::getResponse(); });
- Assign to your plan (Required)
use Leafwrap\PaymentDeals\Models\PaymentTransaction; Route::post('/api/v1/assign-plan', function () { $transactionId = request()->input('transaction_id'); if($payment = PaymentTransaction::where(['transaction_id' => $transactionId])->first()){ // PaymentTransaction have some data attribute // id, transaction_id, user_id, gateway, amount, plan_data, request_payload, response_payload, status if($payment->status === 'completed'){ // Assign code (your business logic) } } });
leafwrap/payment-deals 适用场景与选型建议
leafwrap/payment-deals 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 609 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 09 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 leafwrap/payment-deals 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 leafwrap/payment-deals 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 609
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-04