定制 smronju/laravel-sslcommerz 二次开发

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

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

smronju/laravel-sslcommerz

最新稳定版本:v1.0.0

Composer 安装命令:

composer require smronju/laravel-sslcommerz

包简介

Laravel SSLCommerz is a super easy package to integrate SSLCommerz on Laravel websites.

README 文档

README

Laravel SSLCommerz Package

Laravel SSLCommerz

Latest Version on Packagist GitHub Tests Action Status Total Downloads License

Integrate SSLCommerz into your Laravel application in minutes. This package provides a clean, fluent API to handle payments, validations, and refunds with zero hassle.

🚀 Quick Start in 3 Steps

1. Install via Composer

composer require smronju/laravel-sslcommerz

2. Configure Your Environment

Add your credentials to your .env file:

SSLCOMMERZ_STORE_ID=your_id
SSLCOMMERZ_STORE_PASSWORD=your_password
SSLCOMMERZ_STORE_CURRENCY=BDT # Optional (default: BDT)
SSLCOMMERZ_SANDBOX=true # Set false for production (default: true)

✨ How to get sandbox credentials

SSLCommerz credentials are required to use this package. You can get sandbox credentials by following these steps:

  1. Create Sandbox Account: Visit the https://developer.sslcommerz.com/registration/ page to create an account.

  2. Obtain Credentials: After registration, you will receive your Store ID and Store Password via email or from the SSLCommerz dashboard.

  3. Set Up in .env: Copy these credentials and paste them into your .env file as shown in the Configuration step.

Important

Sandbox credentials are for testing purposes only. You should replace them with your live credentials and change SANDBOX=false before deploying to production.

3. Initialize & Publish (Optional)

This will publish the configuration file to config/sslcommerz.php:

php artisan laravel-sslcommerz:install

💡 Simple Usage

💳 Initiate a Payment

The package uses a fluent interface to prepare and trigger the payment.

use Smronju\Sslcommerz\Facades\Sslcommerz;

$response = Sslcommerz::setOrder($amount, $invoiceId, $productName)
    ->setCustomer($name, $email, $phone)
    ->makePayment();

if ($response->success()) {
    return redirect($response->gatewayPageURL());
}

✅ Validate Payment

Simply pass the request data and expected transaction details.

$isValid = Sslcommerz::validatePayment($request->all(), $transactionId, $amount);

if ($isValid) {
    // Save to database, update status, etc.
}

🛠 Advanced Features

Handling Callbacks

Define your routes in routes/web.php:

Route::post('/sslcommerz/success', [SslcommerzController::class, 'success'])->name('sslcommerz.success');
Route::post('/sslcommerz/failure', [SslcommerzController::class, 'failure'])->name('sslcommerz.failure');

Refunds & Status Checks

// Request a refund
$refund = Sslcommerz::refundPayment($bankTranId, $amount, "Customer requested refund");

// Check refund status
$status = Sslcommerz::checkRefundStatus($refundRefId);

🔥 Features at a Glance

  • PHP 8.2+ & Laravel 12-13 support.
  • 🛠 Fluent API: Ready-to-use methods for customer info, shipping info, etc.
  • 🔒 Secure: In-built hash verification and data validation.
  • 📦 Zero Config: Works out of the box with sensible defaults.
  • 🧪 Sandbox Ready: Easy toggle between sandbox and live environments.

📖 Documentation

For detailed guides on dynamic parameters, IPN handling, and advanced configurations, visit the Documentation Wiki.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固