承接 husail/paystore-sdk 相关项目开发

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

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

husail/paystore-sdk

最新稳定版本:v1.0.0-alpha

Composer 安装命令:

composer require husail/paystore-sdk

包简介

PayStore PHP SDK

README 文档

README

The PayStore PHP SDK allows integration with the PayStore API in any PHP project. It also provides Facades and a Service Provider for enhanced Laravel integration.

📦 Installation

composer require husail/paystore-sdk

🔧 Usage Example

For Non-Laravel PHP Projects:

Basic Usage:

require 'vendor/autoload.php';

use Husail\PayStore\Client;
use Husail\PayStore\Authentication;

$client = new Client(
    new Authentication(token: 'your-token')
);

$response = $client->merchant->all();
if ($response->successful()) {
    // Handle the response
}

With Logging:

require 'vendor/autoload.php';

use Monolog\Logger;
use Husail\PayStore\Client;
use Monolog\Handler\StreamHandler;
use Husail\PayStore\Authentication;
use Husail\PayStore\HttpClient\Message\Formatter\SimpleFormatter;

$logger = new Logger('my_logger');
$logger->pushHandler(new StreamHandler(__DIR__ . '/paystore.log'));

$client = new Client(
    new Authentication(token: 'your-token'),
    logger: $logger,
    formatter: new SimpleFormatter(true) // 'true' enables pretty-printed JSON logs
);

$response = $client->merchant->all();
if ($response->successful()) {
    // Handle the response
}

For Laravel:

  1. Publish the configuration:

    php artisan vendor:publish --provider="Husail\PayStore\PayStoreServiceProvider"
  2. Add environment variables in your .env file:

    PAYSTORE_TOKEN=your-token
    
    # Optional logging settings:
    PAYSTORE_LOG_ENABLED=false             # Enable or disable request/response logging
    PAYSTORE_LOG_FORMATTER_EXPANDED=false  # Pretty-print JSON in logs if enabled
  3. Use the Facade to interact with the API:

use PayStore;

$response = PayStore::client()->merchant->all();
if ($response->successful()) {
    // Handle the response
}
  1. Configure Logging

    When PAYSTORE_LOG_ENABLED is set to true, the SDK logs request and response details via Laravel's default logging channel. By default, logs output compact JSON. If you want the JSON output to be more readable (pretty-printed), set PAYSTORE_LOG_FORMATTER_EXPANDED to true.

🤝 Contributing

We welcome contributions! Feel free to submit issues or pull requests to help improve the SDK.

📜 License

Licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-03