mvenghaus/saloon-plenty-connector 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mvenghaus/saloon-plenty-connector

Composer 安装命令:

composer require mvenghaus/saloon-plenty-connector

包简介

Saloon Connector for Plenty

README 文档

README

Saloon - Plentymarkets Connector with token handling, allowing you to easily start building your own requests.

Installation

Install the package via composer:

composer require mvenghaus/saloon-plenty-connector

Usage

Basic Structure

$configuration = new Configuration(...);
$apiConnector = new ApiConnector($configuration);

$response = $apiConnector->send(new Your_Request());

Configuration - Structure

class Configuration
{
    public function __construct(
        public string $endpoint, // https://www.your-domain.com/rest/
        public string $username,
        public string $password,
        public ?string $authenticator = null, // saloon authenticator (serialized)
        public ?Closure $authenticatorUpdateCallback = null, // callback to save authenticator if changed
        public ?Closure $debugCallback = null // callback for debugging
    ) {
    }
}

Configuration - Example

$authenticator = load_from_your_cache();

$configuration = new Configuration(
    'https://www.your-domain.com/rest/',
    'USERNAME',
    'PASSWORD',
    $authenticator,
    function (string $authenticator) {
        save_to_your_cache($authenticator);
    },
    function (PendingRequest $pendingRequest, RequestInterface $psrRequest) {
        echo $pendingRequest->getUrl() . PHP_EOL;
    }
);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-31