riesenia/sps-webship-api

SPS Webship Api PHP客户端实现

v1.3.0 2023-05-02 13:27 UTC

This package is auto-updated.

Last update: 2024-08-31 00:33:15 UTC


README

SPS Webship API PHP客户端实现。有关详细信息,请参阅web服务文档

安装

使用 composer require riesenia/sps-webship-api 安装最新版本

使用方法

使用用户名和密码创建API

use Riesenia\SpsWebship\Api;

$api = new Api($username, $password);

创建运输

$data = [
    'cod' => [
        'codvalue' => 12.30
    ],
    'insurvalue' => 12.30,
    'notifytype' => 1,
    ...
];

if (!$api->createShipment($shipment)) {
    echo $api->getMessages();
}

打印运输标签

$url = $api->printShipmentLabels();

if (!$url) {
    echo $api->getMessages();
}

打印日终报告

$url = $api->printEndOfDay();

if (!$url) {
    echo $api->getMessages();
}