GithubHelp home page GithubHelp logo

medy36 / mlpostmasterbundle Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 160 KB

MLPostMasterBundle Symfony2 bundle for PostMaster API platform for shipping packages

Home Page: https://www.postmaster.io/

PHP 100.00%

mlpostmasterbundle's Introduction

MLPostMasterBundle

Symfony2 bundle for PostMaster API (https://www.postmaster.io/)

License

MLPostMasterBundle is licensed under the MIT License - see the Resources/meta/LICENSE file for details

Requirements

    "require": {
			"php": ">=5.3.2",
			"symfony/framework-bundle": "2.*"
			},

Installation:

  • add to your composer.json in the require section: "lasri/postmaster-bundle": "dev-master"

  • install your dependecies:

    php composer.phar require "lasri/postmaster-bundle": "dev-master"

  • add the bundle to your AppKernel:

    new ML\PostMasterBundle\MLPostMasterBundle(),

  • in your config.yml

ml_post_master:
    	api_key: **********your api key here ***************

Issues

Please use appropriately tagged github issues to request features or report bugs.

###Usage:


	$postmaster = $this->get('postmaster');
	$add= $postmaster->getAddressValidation();
    	$addR= $add->validate(array("company" => "Postmaster Inc.",
		"contact" => "Joe Smith",
		"line1" => "701 Brazos St. Suite 1616",
		"city" => "Austin",
		"state" => "TX",
		"zip_code" => "78701",
		"country" => "US",
    	));

        var_dump($addR);

        $tran = $postmaster->getTransitTimes();
        $tranR = $tran->get(
        array(
	        "from_zip" => "78701",
	        "to_zip" => "78709",
	        "weight" => 22.5,
	        "carrier" => "fedex",
        ));
        
        var_dump($tranR);

        $rate = $postmaster->getRates();
        $rateR = $rate->get(array(
	        "from_zip" => "78701",
	        "to_zip" => "78704",
	        "weight" => 0.5,
	        "carrier" => "fedex",
        ));
        
        var_dump($rateR); 
  
        $ship = $postmaster->getShipment();
        $shipR = $ship->create(array(
	        "to" => array(
	        "company" => "Postmaster Inc.",
	        "contact" => "Louardi Abdeltif",
	        "line1" => "701 Brazos St. Suite 1616",
	        "city" => "Austin",
	        "state" => "TX",
	        "zip_code" => "78701",
	        "phone_no" => "512-693-4040",
        ),
        "from" => array(
        "company" => "Postmaster Inc.",
        "contact" => "Joe Smith",
        "line1" => "701 Brazos St. Suite 1616",
        "city" => "Austin",
        "state" => "TX",
        "zip_code" => "78701",
        "phone_no" => "512-693-4040",
        ),
        "carrier" => "fedex",
        "service" => "2DAY",
        "package" => array(
        "weight" => 1.5,
        "length" => 10,
        "width" => 6,
        "height" => 8,
        "label" =>array(
            "format" => "NORMAL",
            ),
        ),
        ));
        
        var_dump($shipR);

        /* monitor external package */
        $trac = $postmaster->getTracking();
        $tracR = $trac->monitor_external(array(
	        "tracking_no" => "1ZW470V80310800043",
	        "url" => "http://example.com/your-http-post-listener",
	        "events" => ["Delivered", "Exception"]
        ));
        
        var_dump($tracR);

        /* create box example */
        $pack = $postmaster->getPackage();
        $packR = $pack->create(array(
	        "width" => 10,
	        "height" => 12,
	        "length" => 8,
	        "name" => 'My Box'
        ));
        var_dump($packR);

        die;
        ```

mlpostmasterbundle's People

Contributors

medy36 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.