定制 achetibi/laravel-satim 二次开发

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

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

achetibi/laravel-satim

最新稳定版本:v1.1.1

Composer 安装命令:

composer require achetibi/laravel-satim

包简介

Laravel package for integrating SATIM online payments.

README 文档

README

Latest Version on Packagist Total Downloads Tests License

Laravel Satim is a clean, extensible Laravel package that provides seamless integration with the Satim online payment gateway.
It supports full transaction lifecycle handling: registration, confirmation, and refund, all wrapped in a service-oriented architecture.

🚀 Features

  • Simple configuration via .env
  • Clean service classes for payment flow:
    • Register
    • Confirm
    • Refund
  • Built-in error handling and response abstraction
  • Custom HTTP client wrapper using Laravel's Http facade
  • Laravel-native setup with service provider, config, and facade

📦 Installation

composer require achetibi/laravel-satim

⚙️ Configuration

Publish the config file:

php artisan vendor:publish --provider="LaravelSatim\SatimServiceProvider"

Add the following variables to your .env:

SATIM_USERNAME=your_username
SATIM_PASSWORD=your_password
SATIM_TERMINAL=your_terminal
SATIM_LANGUAGE=fr
SATIM_CURRENCY=DZD
SATIM_API_URL=https://fake.satim.dz/payment/rest

You can also set the http client configuration in the config/satim.php using your .env file:

SATIM_HTTP_VERIFY_SSL=true
SATIM_HTTP_TIMEOUT=30
SATIM_HTTP_CLIENT_RETRY=3
SATIM_HTTP_CLIENT_SLEEPTIME=300

You can disable SSL verification in development environments only. You can also set the number of retries and the sleep time between each retry for failed requests.

🧠 Basic Usage

Register a transaction

use LaravelSatim\Contracts\SatimInterface;
use LaravelSatim\Http\Requests\SatimRegisterRequest;

$response = app(SatimInterface::class)->register(SatimRegisterRequest::make(
    orderNumber: 'ORD-123456',
    amount: 1500,
    returnUrl: route('payment.success'),
    udf1: 'ORD-123456'
));

Confirm a transaction

use LaravelSatim\Contracts\SatimInterface;
use LaravelSatim\Http\Requests\SatimConfirmRequest;

$response = app(SatimInterface::class)->confirm(SatimConfirmRequest::make(
    orderId: 'BnTjnFDzZSP97QXu8FXq'
));

Refund a transaction

use LaravelSatim\Contracts\SatimInterface;
use LaravelSatim\Http\Requests\SatimRefundRequest;

$response = app(SatimInterface::class)->refund(SatimRefundRequest::make(
    orderId: 'BnTjnFDzZSP97QXu8FXq',
    amount: 1500
));

All services return typed response or throw custom exceptions for errors.

Overriding language and currency (optional)

By default, the values for language and currency are loaded from your .env file.
If you need to override them on a per-request basis, you can call setLanguage() and setCurrency() on the service before executing the request:

use LaravelSatim\Contracts\SatimInterface;
use LaravelSatim\Enums\SatimLanguage;
use LaravelSatim\Enums\SatimCurrency;

$service = app(SatimInterface::class)
    ->setLanguage(SatimLanguage::AR)
    ->setCurrency(SatimCurrency::DZD);

$response = $service->register(SatimRegisterRequest::make(
    orderNumber: 'ORD-123456',
    amount: 1500,
    returnUrl: route('payment.success'),
    udf1: 'ORD-123456'
));

✅ Testing

Run the test suite:

composer test

📌 Roadmap

  • Register / Confirm / Refund operations
  • Request / Response validation layer
  • Exception mapping
  • End-to-end test suite with fake HTTP responses
  • Status operation
  • Webhook support

🔒 Security

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

🙏 Credits

📄 License

The MIT License (MIT).
See LICENSE.md for full license text.

统计信息

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

GitHub 信息

  • Stars: 12
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-28