承接 pwinty/php-pwinty 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pwinty/php-pwinty

最新稳定版本:2.1.1

Composer 安装命令:

composer require pwinty/php-pwinty

包简介

PHP API wrapper for Pwinty.com

README 文档

README

A PHP implementation of the Pwinty HTTP API v2.1

Based on an implementation of API v1 by Brad Pineau

Installation

With Composer

Add the following to the require section of your composer.json file:

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

Without Composer

Add this line to your application:

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

Declare a new instance of php-pwinty

use pwinty\PhpPwinty;

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

Example Usage

Catalogue

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

Countries

$countries = $pwinty->getCountries();   

Orders

//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

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

统计信息

  • 总下载量: 572
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 6
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: CC-BY-3.0
  • 更新时间: 2014-11-12