xywl/soazposting

A sdk for soazposting api

v1.0 2017-07-12 07:30 UTC

This package is not auto-updated.

Last update: 2024-05-12 01:00:20 UTC


README

A sdk for soazposting api

Installation

composer install xywl/soazposting

Usage

Demo code

  • Initialize a api client
use XYWL\SoazPosting\Client;

// set apiUsername, apiTokent, soazUsername, wsdlUri
$client = new Client("apiUsername", "apiTokent", "soazUsername", "wsdlUri");

//Or

$client =  new Client();
$client->setApiUsername('name')
    ->setApiToken('token')
    ->setSoazUsername('otherName')
    ->setWSDLUri('uri');

This sdk maintain two api request Class, XYWL\SoazPosting\CreateSoazOrderRequest for create order record , and XYWL\SoazPosting\GetSoazAddressPackRequest for get address pack file binary data.

Here go for code:

  • Make a request for create order record, then will get a response which instance of XYWL\SoazPosting\Base\createSoazOrderResponse
use XYWL\SoazPosting\CreateSoazOrderRequest;

$request = new CreateSoazOrderRequest();

// set request parameters according to api document

$request->setXXX()

//now use client to handle request

$response = $client->handle($request);

//var_dump($response);
  • Make a request for get address pack file, then will get a response which instance of XYWL\SoazPosting\Base\getSoazAddressPackResponse
use XYWL\SoazPosting\GetSoazAddressPackRequest;

$request = new GetSoazAddressPackRequest();

// set request parameters according to api document

$request->setXXX()

//now use client to handle request

$response = $client->handle($request);

//var_dump($response);