thegrommet/sps-connector

A PHP library for integrating with SPS Commerce via SFTP

v1.0.1 2019-03-06 17:11 UTC

This package is auto-updated.

Last update: 2024-11-07 05:55:54 UTC


README

A PHP library for integrating with SPS Commerce via SFTP.

Build status

CircleCI

Install

composer require thegrommet/sps-connector

Usage

GS1 Label Generation

See generate-label.php

use SpsConnector\Document\ShippingLabel;
use SpsConnector\LabelService;

$labelDocument = new ShippingLabel();
$label = $labelDocument->addLabel();
// add label specifics

$service = new LabelService('username', 'password');
$pdf = $service->getLabel($labelDocument->__toString(), '5311', $service::FORMAT_PDF);
file_put_contents('label.pdf', $pdf);

Running tests

composer test

Code sniff & fix

# sniff src folder
composer cs
# sniff tests folder
composer cs-tests

# fix src folder
composer cbf
# fix tests folder
composer cbf-tests