anthogirard/delivengo-sdk

此包已被弃用,不再维护。未建议替代包。

Delivengo Easy v2.3 API 的 PHP 客户端库

1.2.1 2020-06-16 22:29 UTC

This package is auto-updated.

Last update: 2022-06-05 19:53:35 UTC


README

要求

  • PHP 5.3+
  • Composer
  • cURL
  • Delivengo API 密钥

安装

使用 composer

composer require anthogirard/delivengo-sdk

使用方法

列出 Mandats 请求示例

$client = new \DelivengoSDK\DelivengoClient('API_KEY');

$request = new \DelivengoSDK\Request\ListMandatsRequest();
$response = $client->send('list', $request);

/** @var \DelivengoSDK\Entity\Mandat[] $data */
$mandats = $response->getData();
foreach ($mandats as $mandat) {
    $rum = $mandat->getRum();
    $iban = $mandat->getIban();
    $bic = $mandat->getBic();
}

检索 Envoi 请求示例

$client = new \DelivengoSDK\DelivengoClient('API_KEY');

$request = new \DelivengoSDK\Request\GetEnvoiRequest();
$response = $client->send('get', $request, ['id' => 1, 'support' => 4, 'position' => 2]);

/** @var \DelivengoSDK\Entity\Envoi $envoi */
$envoi = $response->getData();
$dateCreation = $envoi->getDateCreation();
$plis = $envoi->getPlis();