定制 leafwrap/payment-deals 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

leafwrap/payment-deals

最新稳定版本:2.0.0

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)
        }
    }
});

统计信息

  • 总下载量: 600
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固