frankperez87/pma-fulfillment 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

frankperez87/pma-fulfillment

最新稳定版本:v1.0.5

Composer 安装命令:

composer require frankperez87/pma-fulfillment

包简介

Allows you to connect easily to PMA and send items to ship.

README 文档

README

This is an unofficial API for PMA.

####Install via Composer

composer require frankperez87/pma-fulfillment

####Use Example:

<?php
require 'vendor/autoload.php';

use PMA\Account;
use PMA\BillingAddress;
use PMA\Order;
use PMA\PMA;
use PMA\Product;
use PMA\ShippingAddress;

try {
    // Instantiate PMA Account Class
    $account = new Account('client number here', "username", "password");

    // Instantiate Order Class
    $order = new Order();

    // Set Order Details
    $order->setTransactionNumber('TEST123');
    //$order->setEmail(''); // Optional
    $order->setOrderDate('01-01-2015');
    //$order->setCustomerNumber(''); // Optional
    $order->setOrderType('BULK');
    $order->setPaymentAmount(11.08);
    $order->setShippingAmount(2.50);
    $order->setTaxAmount(2.59);
    $order->setSourceCode('Internet');
    $order->setSource('Internet');

    // Add Products
    $order->addProduct(new Product('PROD123', 1, 5.99));

    // Instantiate Shipping Class
    $shipping = new ShippingAddress();
    //$shipping->setAttn('Test'); Optional
    $shipping->setFirstName('Frank');
    $shipping->setLastName('Test'); // Optional
    $shipping->setAddressOne('123 Main Street');
    //$shipping->setAddressTwo(''); // Optional
    $shipping->setCity('Davie');
    $shipping->setState('FL');
    $shipping->setZip('33314');
    $shipping->setCountry('USA');
    //$shipping->setPhoneNumber(''); // Optional
    $shipping->setAddressType('RESIDENTIAL');
    $shipping->setShipMethod('UPSMI');

    // Instantiate Shipping Class
    $billing = new BillingAddress();
    $billing->setFirstName('Frank');
    $billing->setLastName('Test'); // Optional
    $billing->setAddressOne('123 Main Street');
    //$billing->setAddressTwo(''); // Optional
    $billing->setCity('Davie');
    $billing->setState('FL');
    $billing->setZip('33314');
    $billing->setCountry('USA');

    // Add Shipping and Billing Objects to Order
    $order->addShippingAddress($shipping);
    $order->addBillingAddress($billing);

    $pma = new PMA($account);
    $pma->setOrder($order);
    $response = $pma->send();

} catch(InvalidArgumentException $e) {
    echo $e->getMessage(); // Outputs any errors returned
}
?>

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-28