Download the PHP package dgoring/php-pwinty without Composer
On this page you can find all versions of the php package dgoring/php-pwinty. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download dgoring/php-pwinty
More information about dgoring/php-pwinty
Files in dgoring/php-pwinty
Download dgoring/php-pwinty
More information about dgoring/php-pwinty
Files in dgoring/php-pwinty
Vendor dgoring
Package php-pwinty
Short Description PHP API wrapper for Pwinty.com
License CC-BY-3.0
Package php-pwinty
Short Description PHP API wrapper for Pwinty.com
License CC-BY-3.0
Please rate this library. Is it a good library?
Informations about the package php-pwinty
PHP Pwinty v3.0
A PHP implementation of the Pwinty HTTP API v2.3
Installation
Composer
Add the following to the require section of your composer.json file:
"dgoring/php-pwinty": "^3.0"
Declare a new instance of php-pwinty
$config = array(
'api' => 'sandbox',
'merchantId' => 'xxxxxxxxxxxxxxxxx',
'apiKey' => 'xxxxxxxxxxxxxxxxx'
);
$pwinty = new Pwinty\Connnection($config);
Example Usage
Catalogue
$catalogue = $pwinty->catalogue(
"GB", //country code
"Pro" //quality
);
Countries
$countries = $pwinty->countries();
Orders //gets all orders $orders = $pwinty->orders()->get();
//gets one order
$order = $pwinty->orders()->find( 123 );
//creates a new order
$order = $pwinty->orders()->create(array(
'name' => 'Chuck Norris',
'email' => '[email protected]',
'address_1' => '123 Some Road',
'address_2' => 'Some place',
'town' => 'Some town',
'state' => 'Some state',
'postalOrZipCode' => '12345',
'countryCode' => 'GB',
'destinationCountryCode' => 'GB',
'useTrackedShipping' => true,
'payment' => 'InvoiceMe',
'qualityLevel' => 'Pro'
));
//edit an order
$order = $pwinty->orders()->find( 123 );
$order->name = 'Bob';
$order = $pwinty->assign(array(
'name' => 'Chuck Norris',
'email' => '[email protected]',
'address_1' => '123 Some Road',
'address_2' => 'Some place',
'town' => 'Some town',
'state' => 'Some state',
'postalOrZipCode' => '12345',
));
$order->save();
//change order status
$order = $pwinty->orders()->find( 123 );
$pwinty->submit(
'Cancelled' //status
);
Photos
//gets information about photos for an order
$order = $pwinty->orders()->find( 123 );
$photos = $order->photos()->get();
//gets information about a single photo
$order = $pwinty->orders()->find( 123 );
$photo = $order->photos()->find( 123 );
//adds a photo
$order = $pwinty->orders()->find( 123 );
$photo = $order->photos()->create(array(
'type' => 'fridge_magnet',
'url' => 'http://example.com/photo.jpg',
'file' => './path/to/file,
'copies' => 1,
'sizing' => 'ShrinkToFit',
'price' => 200,
'priceToUser' => 240,
'attributes' => array(),
));
//delete a photo
$order = $pwinty->orders()->find( 123 );
$photo = $order->photos()->find( 123 );
$photo->destroy();
Issues
//gets information about issues for an order
$order = $pwinty->orders()->find( 123 );
$issues = $order->issues()->get();
//gets information about a single issue
$order = $pwinty->orders()->find( 123 );
$issue = $order->issues()->find( 123 );
//adds a issue
$order = $pwinty->orders()->find( 123 );
$issue = $order->issues()->create(array(
'issue' => 'WrongFrameColour',
'issueDetail' => 'It wasn\'t pink!',
'action' => 'Reprint',
'actionDetail' => 'Needs to be PINK!',
'affectedImages' => '123,673,123',
));
//edit a issue
$issue->assign(array(
'comment' => 'Still not Pink',
));
$issue->save();
//delete a issue
$order = $pwinty->orders()->find( 123 );
$issue = $order->issues()->find( 123 );
$issue->destroy();
All versions of php-pwinty with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6.0
ext-curl Version *
ext-curl Version *
The package dgoring/php-pwinty contains the following files
Loading the files please wait ....