承接 afzalsabbir/sslaracommerz 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

afzalsabbir/sslaracommerz

Composer 安装命令:

composer require afzalsabbir/sslaracommerz

包简介

A package for SSLCommerz Payment Gateway. Inspired by https://github.com/sslcommerz/SSLCommerz-Laravel

README 文档

README

A package for SSLCommerz Payment Gateway
Inspired by SSLCommerz
SSLCommerz Payment gateway library for Laravel framework. Official documentation is here.

Software License Latest Version on Packagist Build Status Quality Score Commits Since

GitHub contributors GitHub issues GitHub issues

GitHub forks GitHub stars GitHub watchers GitHub followers Twitter Follow

Total Downloads GitHub code size in bytes GitHub repo size in bytes

GitHub last commit GitHub commit activity the past week, 4 weeks, year GitHub commit activity the past week, 4 weeks, year GitHub commit activity the past week, 4 weeks, year

GitHub release GitHub release date

GitHub tag GitHub release GitHub release

Tags: Payment Gateway, SSLCommerz, IPN, Laravel, SSLaraCommerz

Requires: Laravel >= 5.6 and MySQL

License: MIT License

Install

composer require afzalsabbir/sslaracommerz

Migration

php artisan migrate

Instructions

Vendor Publish - Required

# Public Assets
php artisan vendor:publish --provider="AfzalSabbir\SSLaraCommerz\SSLaraCommerzServiceProvider" --tag="public-assets"

Public Assets: To integrate popup checkout, use the below script before the end of body tag.

  • For Sandbox

    <script>
        (function (window, document) {
            var loader = function () {
                var script = document.createElement("script"),
                    tag    = document.getElementsByTagName("script")[0];
                script.src = "https://sandbox.sslcommerz.com/embed.min.js?" + Math.random().toString(36).substring(7);
                tag.parentNode.insertBefore(script, tag);
            };
    
            window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
        })(window, document);
    </script>

    or, Publish the Public Assets and use the below sandbox script

    <script src="/assets/js/sandbox.js"></script>
  • For Live

    <script>
        (function (window, document) {
            var loader = function () {
                var script = document.createElement("script"),
                    tag    = document.getElementsByTagName("script")[0];
                script.src = "https://seamless-epay.sslcommerz.com/embed.min.js?" + Math.random().toString(36).substring(7);
                tag.parentNode.insertBefore(script, tag);
            };
    
            window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
        })(window, document);
    </script>

    or, Publish the Public Assets and use the below live script

    <script src="/assets/js/live.js"></script>
# Routes and Controller
php artisan vendor:publish --provider="AfzalSabbir\SSLaraCommerz\SSLaraCommerzServiceProvider" --tag="routes-controller"

Routes and Controller: To customize the routes and controller, use the below command.

  • Add $this->loadRoutesFrom(base_path('routes/sslcommerz.php')); in app/Providers/RouteServiceProvider.php
    namespace App\Providers;
    
    // ...
    
    class RouteServiceProvider extends ServiceProvider
    {
        // ...
        public function boot()
        {
            // ...
            $this->loadRoutesFrom(base_path('routes/sslcommerz.php'));
        }
        // ...
    }

Vendor Publish - Optional

# Config
php artisan vendor:publish --provider="AfzalSabbir\SSLaraCommerz\SSLaraCommerzServiceProvider" --tag="config"

# Views
## Namespace: sslaracommerz
php artisan vendor:publish --provider="AfzalSabbir\SSLaraCommerz\SSLaraCommerzServiceProvider" --tag="views"

# Migrations
php artisan vendor:publish --provider="AfzalSabbir\SSLaraCommerz\SSLaraCommerzServiceProvider" --tag="migrations"

Note: If you later encounter issues with session destroying after redirect, you can set 'same_site' => null, in your config/session.php file.

  • Step 1: Add STORE_ID and STORE_PASSWORD values on your project's .env file. You can register for a store at https://developer.sslcommerz.com/registration/

  • Step 2: Add the below routes into the $excepts array of VerifyCsrfToken middleware.

    protected $except = [
        '/pay-via-ajax', '/success','/cancel','/fail','/ipn'
    ];

Now, let's go to the main integration part.

  • Step 3: Use the below button where you want to show the "Pay Now" button:

    <button class="your-button-class" id="sslczPayBtn"
            token="if you have any token validation"
            postdata="your javascript arrays or objects which requires in backend"
            order="If you already have the transaction generated for current order"
            endpoint="/pay-via-ajax"> Pay Now
    </button>
  • Step 4: For EasyCheckout (Popup) integration, you can update the checkout_ajax.php or use a different file according to your need. We have provided a basic sample page from where you can kickstart the payment gateway integration.

  • Step 5: For Hosted Checkout integration, you can update the checkout_hosted.php or use a different file according to your need. We have provided a basic sample page from where you can kickstart the payment gateway integration.

  • Step 6: For redirecting action from SSLCommerz Payment gateway, we have also provided sample success.php , cancel.php, fail.phpfiles. You can update those files according to your need.

Original Documentation

For more clear concept read: SSLCommerz README.md

Testing

Run the tests with:

vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email afzalbd1@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

afzalsabbir/sslaracommerz 适用场景与选型建议

afzalsabbir/sslaracommerz 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 144 次下载、GitHub Stars 达 22, 最近一次更新时间为 2022 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「sslcommerz」 「SSLCommerzBD」 「SSLaraCommerz」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 afzalsabbir/sslaracommerz 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 afzalsabbir/sslaracommerz 我们能提供哪些服务?
定制开发 / 二次开发

基于 afzalsabbir/sslaracommerz 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 22
  • Watchers: 6
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-11