Download the PHP package opensoft/inkrouter-php-sdk without Composer

On this page you can find all versions of the php package opensoft/inkrouter-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package inkrouter-php-sdk

Introduction

InkRouter's PHP SDK is the Job Submission interface to the InkRouter Printing Network. To send print orders directly from your website to InkRouter, you will use the InkRouter PHP SDK as documented here.

The InkRouter PHP SDK is a library for easy interaction with the InkRouter interface from PHP.

Build Status

Requirements

This SDK requires:

Installation

With Composer:

$ composer require opensoft/inkrouter-php-sdk

Without Composer:

InkRouter Workflow

InkRouter interface workflow consists of 6 actions:

Get InkRouter client instance

Prior to performing any operations, perform get instance of InkRouter client, example:

$InkRouterClient = new InkRouter_Client_Client($wsdl, $printCustomerId, $secretKey);

Where:

Create InkRouter_Models_OrderInfo instance (with example data)

$contact = new InkRouter_Models_Contact();
$contact->setName('contact_name')
    ->setPhone('contact_phone')
    ->setEmail('contact_email');

$headerInfo = new InkRouter_Models_HeaderInfo();
$headerInfo->setFromDomain('yoursite.com')
    ->setFromIdentity('your_identity');

$shipType = new InkRouter_Models_ShipType();
$shipType->setMethod('UPS')
    ->setServiceLevel('GROUND');

$shipAddress = new InkRouter_Models_ShipAddress();
$shipAddress->setAttention('Attention')
    ->setStreetAddress('742 Evergreen Terrace')
    ->setCity('Springfield')
    ->setState('CA')
    ->setZip('1234567')
    ->setCountry('USA');

$requester = new InkRouter_Models_Requester();
$requester->setName('Any Prints')
    ->setContract('STANDARD')
    ->setPayTerm('FREE');

$poInfo = new InkRouter_Models_PoInfo();
$poInfo->setAgentId('agentId')
    ->setCurrency('US');

$printAsset = new InkRouter_Models_PrintAsset();
$printAsset->setPositionX(4.98)
    ->setPositionY(3.1)
    ->setRotation(-90)
    ->setType('BARCODE')
    ->setHeight(0.543)
    ->setWidth(2.12);

$side = new InkRouter_Models_Side();
$side->setPageNumber(10)
    ->setFileUrl('http://server/img.jpg')
    ->setFileHash('0a0825909aa15a98b00574661f23aee7')
    ->setCoating('NONE')
    ->setOrientation('Landscape')
    ->addPrintAsset($printAsset);

$attributes = new InkRouter_Models_Attributes_ScalarBooleanAttribute();
    $attributes->setType('LABELING');
    $attributes->setValue(true);

$orderItem = new InkRouter_Models_OrderItem();
$orderItem->setPrintGroupId('pg4f7969f8a4811')
    ->setProductType('business cards')
    ->setPaperType('14PT')
    ->setQuantity(500)
    ->setRegionSize('US')
    ->setCost(20.3)
    ->addAttributes($attributes)
    ->addSide($side);

$order = new InkRouter_Models_Order();
$order->setPrintCustomerInvoice(123456789)
    ->setTsCreated(date(DATE_ATOM, strtotime('now')))
    ->setPriority(0)
    ->setShippingFee(10)
    ->setProductDiscounts(0)
    ->setShippingDiscounts(0)
    ->setVendorId('vendor_id')
    ->setContact($contact)
    ->setShipType($shipType)
    ->setRequester($requester)
    ->setShipAddress($shipAddress)
    ->addOrderItem($orderItem);

$orderInfo = new InkRouter_Models_OrderInfo();
$orderInfo->setHeaderInfo($headerInfo)
    ->setPrintCustomerId('ID')
    ->setPoInfo($poInfo)
    ->setOrder($order);

Create order to InkRouter

After creating the instance of InkRouter Models_OrderInfo Create Order to InkRouter as below:

try {
    $orderId = $InkRouterClient->createOrder($timestamp, $orderInfo);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Create operation failed';
}

Where:

Update order

You should first create instance of InkRouter Models OrderInfo and call update method:

try {
    $InkRouterClient->updateOrder($orderId, $timestamp, $orderInfo);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Update operation failed';
}            

Where:

Place on hold order

For place on hold order with id $orderId you should do:

try {
    $InkRouterClient->placeOnHold($orderId, $timestamp);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Place on hold operation failed';
}  

Remove hold order

For remove order from hold with id $orderId you should do:

try {
    $InkRouterClient->removeHold($orderId, $timestamp);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Remove hold operation failed';
}

Cancel order

For cancel order with id $orderId you should do:

try {
    $InkRouterClient->cancelOrder($orderId, $timestamp);
} catch (InkRouter_Exceptions_Exception $e) {
    echo 'Cancel operation failed';
}

Receive order updates from InkRouter

For successful receiving update messages from InkRouter, you should make any controller, which can receive post requests, add url of this controller in your account through InkRouter-dashboard. Then you can use InkRouter_Response_Response class for parsing xml string from post content:

$updates = InkRouter_Response_Response::fromPack($xml)->getUpdates();

where $updates is array of InkRouter_Response_Update objects and you can use it as you want.


All versions of inkrouter-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
ext-curl Version >=7.2
ext-dom Version 20031129
ext-soap Version >=7.2.0
ext-xmlwriter Version >=7.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package opensoft/inkrouter-php-sdk contains the following files

Loading the files please wait ....