2017 © Pedro Peláez
 

library php-pwinty

PHP API wrapper for Pwinty.com

image

pwinty/php-pwinty

PHP API wrapper for Pwinty.com

  • Sunday, July 31, 2016
  • by atwright147
  • Repository
  • 5 Watchers
  • 7 Stars
  • 512 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

PHP Pwinty

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

Based on an implementation of API v1 by Brad Pineau, (*2)

Installation

With Composer

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

"pwinty/php-pwinty": "dev-master"

Without Composer

Add this line to your application:, (*4)

require_once("/pwinty/php-pwinty.php");

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

use pwinty\PhpPwinty;

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

Example Usage

Catalogue, (*6)

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

Countries, (*7)

$countries = $pwinty->getCountries();   

Orders, (*8)

//gets all orders
$order = $pwinty->getOrder(); 

//gets one order
$order = $pwinty->getOrderStatus("1234"); 

//creates a new order
$order = $pwinty->createOrder(
    "Chuck Norris",     //name
    "chuck@norris.com", //email address
    "123 Some Road",    //address1
    "Some place",       //address 2
    "Some town",        //town
    "Some state",       //state
    "12345",            //postcode or zip
    "GB",               //country code
    "GB",               //destination code
    true,               //tracked shipping
    "InvoiceMe",        //payment method
    "Pro"               //quality
);

//updates an order
$order = $pwinty->updateOrder(
    "1234",             //order id
    "Chuck Norris",     //name
    "123 Some Road",    //address1
    "Some place",       //address 2
    "Some town",        //town
    "Some state",       //state
    "12345",            //postcode or zip
);

//change order status
$pwinty->updateOrderStatus(
    "1234,              //orderid
    "Cancelled"         //status
);

//get order status
$order = $pwinty->getOrderStatus(
    "1234"              //order id
);

Photos, (*9)

//gets information about photos for an order
$photos = $pwinty->getPhotos(
    "1234"              //order id
);

//gets information about a single photo
$photo = $pwinty->getPhotos(
    "1234",             //order id
    "123456"            //photo id
);

//adds a photo
$pwinty->addPhoto(
    "1234",                             //order id
    "4x6",                              //print size
    "http://www.mysite.com/photo.jpg",  //image url
    "1",                                //print quantity
    "ShrinkToFit",                      //resize method
    "2000",                             //price to user
    "811cc87f4f77d6c33d638f9def39473b", //md5 hash
    "ewhweo42ufh2woed45f2sdf4yt5sdufw"  //file
);                              

//delete a photo
$pwinty->deletePhoto(
    "1234",             //order id
    "123456"            //photo id
);

The Versions

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

03/07 2016

dev-master

9999999-dev

PHP API wrapper for Pwinty.com

  Sources   Download

CC-BY-3.0

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