Skip to content

A PHP library for integrating with SPS Commerce via SFTP

License

Notifications You must be signed in to change notification settings

thegrommet/sps-connector

Repository files navigation

SPS-Connector

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