承接 azexpressteam/api 相关项目开发

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

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

azexpressteam/api

Composer 安装命令:

composer require azexpressteam/api

包简介

Public Api Class

README 文档

README

As base client for requests use Guzzle5. You can read guzzle6 documentation for more opportunity.

https://az.express/api/docs -- main documentation https://az.express/ -- contacts

use AzExpressTeam\Api;

$api = new Api(['secret_key' => '5f53334da9f84e43b67425ef5gggad23']);

$client_uid = 'TEST000000003';
try {
    // if your request may have clients error as (4xx) use try-catch
    // Create invoice
    $request = $api->invoice()->create([
        'city' => 'Moscow',
        'contact' => 'Test contact name',
        'phone' => '+71112223344',
        'postcode' => '12345',
        'address' => 'Test street name 123',
        'eid' => $client_uid,
        'weight' => 0.5,
    ]);
    $invoice = json_decode($request->getBody());


    // List invoices
    $request = $api->invoice()->getList([
        'ids' => "{$client_uid},TEST000000002"
    ]);
    $invoices = json_decode($request->getBody());


    // Update invoice
    $request = $api->invoice()->update($client_uid, [
        'contact' => 'Test contact name2',
    ]);
    $invoice = json_decode($request->getBody());


    // View invoice
    $request = $api->invoice()->getView($client_uid);
    $invoice = json_decode($request->getBody());


    // Status history invoice
    $request = $api->invoice()->statusHistory($client_uid);
    $invoiceStatusHistory = json_decode($request->getBody());

    // Calculation invoice cost
    $request = $api->invoice()->cost(['weight' => $invoice->weight ?? 0.5]);
    $invoiceCost = json_decode($request->getBody());


    // Delete invoice
    $request = $api->invoice()->delete($client_uid);


    // Invoice status list
    $request = $api->dictionary()->getStatusesList();
    $statuses = json_decode($request->getBody());

    // Invoice pdf sticker in binary format
    $request = $api->invoice()->getPdfSticker($client_uid);
    $binaryFile = $request->getBody();


    // Create manifest
    $request = $api->manifest()->create([
        'type' => \AzExpressTeam\Actions\Manifest::TYPE_COMING,
        'stamp' => 'TEST_MANIFEST_STAMP_1',
        'date' => date('Y-m-d'),
        'invoice_ids' => [
            $client_uid
        ]
    ]);
    $manifest = json_decode($request->getBody());


    // List manifests
    $request = $api->manifest()->getList([
        'date_from' => "2019-01-01",
        'date_to' => date('Y-m-d'),
    ]);
    $manifests = json_decode($request->getBody());


    // Update manifest
    $request = $api->manifest()->update($manifest->id, [
        'stamp' => 'TEST_MANIFEST_STAMP_2',
    ]);
    $manifest = json_decode($request->getBody());


    // View manifest
    $request = $api->manifest()->getView($manifest->id);
    $manifest = json_decode($request->getBody());


    // Delete manifest
    $request = $api->manifest()->delete($manifest->id);


} catch (\GuzzleHttp\Exception\ClientException $e) {
    $response = $e->getResponse();
    $responseBodyAsString = $response->getBody()->getContents();
    $error = json_decode($responseBodyAsString);
} catch (\GuzzleHttp\Exception\ServerException $e) {
    // More information in guzzle v5 documentation
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固