2017 © Pedro Peláez
 

library php-pwinty

PHP API wrapper for Pwinty.com

image

dgoring/php-pwinty

PHP API wrapper for Pwinty.com

  • Friday, August 25, 2017
  • by dgoring
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 11 Versions
  • 4 % Grown

The README.md

PHP Pwinty v3.0

A PHP implementation of the Pwinty HTTP API v2.3, (*1)

Installation

Composer

Add the following to the require section of your composer.json file:, (*2)

"dgoring/php-pwinty": "^3.0"

Declare a new instance of php-pwinty, (*3)

$config = array(
    'api'        => 'sandbox',
    'merchantId' => 'xxxxxxxxxxxxxxxxx',
    'apiKey'     => 'xxxxxxxxxxxxxxxxx'
);
$pwinty = new Pwinty\Connnection($config);

Example Usage

Catalogue, (*4)

$catalogue = $pwinty->catalogue(
    "GB",               //country code
    "Pro"               //quality
);

Countries, (*5)

$countries = $pwinty->countries();

Orders //gets all orders $orders = $pwinty->orders()->get();, (*6)

//gets one order
$order = $pwinty->orders()->find( 123 );

//creates a new order
$order = $pwinty->orders()->create(array(
    'name'                   => 'Chuck Norris',
    'email'                  => 'chuck@norris.com',
    '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'                  => 'chuck@norris.com',
    '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, (*7)

//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, (*8)

//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();

The Versions

25/08 2017

dev-master

9999999-dev

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Requires

  • php >=5.6.0
  • ext-curl *

 

by Brad Pineau

api pwinty pwinty.com

25/08 2017

3.2.1

3.2.1.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Requires

  • php >=5.6.0
  • ext-curl *

 

by Brad Pineau

api pwinty pwinty.com

25/08 2017

3.2.0

3.2.0.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Requires

  • php >=5.6.0
  • ext-curl *

 

by Brad Pineau

api pwinty pwinty.com

23/08 2017

3.1.2

3.1.2.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Requires

  • php >=5.6.0
  • ext-curl *

 

by Brad Pineau

api pwinty pwinty.com

23/08 2017

3.1.1

3.1.1.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Requires

  • php >=5.6.0
  • ext-curl *

 

by Brad Pineau

api pwinty pwinty.com

23/08 2017

3.1.0

3.1.0.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Requires

  • php >=5.6.0
  • ext-curl *

 

by Brad Pineau

api pwinty pwinty.com

23/08 2017

3.0.1

3.0.1.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Requires

  • php >=5.6.0
  • ext-curl *

 

by Brad Pineau

api pwinty pwinty.com

22/08 2017

3.0

3.0.0.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Requires

  • php >=5.6.0
  • ext-curl *

 

by Brad Pineau

api pwinty pwinty.com

31/07 2016

dev-feature/testing

dev-feature/testing

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

The Development Requires

by Brad Pineau

api pwinty pwinty.com

10/01 2016

2.1.1

2.1.1.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

by Brad Pineau

api pwinty pwinty.com

12/11 2014

2.1

2.1.0.0

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

by Brad Pineau

api pwinty pwinty.com