Download the PHP package fhferreira/easyship-php without Composer

On this page you can find all versions of the php package fhferreira/easyship-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package easyship-php

easyship-php

codecov License

A PHP library to make PHP calls to the Easyship API. This library wraps some of the repetitive/ugly work like creating an HTTP client, building and sending requests. The end user will just need to assemble arrays of the appropriate payload data and then evaluate the responses.

This package comprises two distinct sets of functionality. The first is the API communication component, which allows the user to easily write code for sending outbound API calls to the Easyship API. The second is support for receiving inbound webhook posts from Easyship, allowing the user to easily pass those calls into a dispatching handler and have their payloads passed off to custom code attached to the handler using listeners. Webhooks are an optional feature of Easyship's API and there's you can completely ignore them if it's not part of your implementation plan.

API Version

Presently, only API version v1 is supported, as the v2 API is in beta and still not complete. Once v2 is ready for production use, I'll expand this library to support that version as well.

Installation

Unless using Laravel, install with composer like normal:

If using the library in a Laravel application, then you'll probably find it more convenient to install the companion package, easyship-laravel (which will also require this package as a dependency).

In this case, instead run:

See the [easyship-laravel](https://github.com/

for documentation specific to this method.

Usage

All methods return an instance of an object implementing Psr\Http\Message\ResponseInterface, typically GuzzleHttp\Psr7\Response, which can be used as needed see the Guzzle documentation for more.

By default, all of the calls are made using the request option 'http_errors' => true, which means that exceptions will be thrown if any requests fail. The EasyshipAPI::request() method docblock shows which exceptions you can expect to be thrown. The library allows all exceptions to bubble up to the application so that the developer can choose how to handle them at implementation. You can override this option in the options array passed into the EasyshipAPI constructor, if you prefer.

Of course, if you're using another PSR7-compatible client, then you'll presumably get some exception based on \RuntimeException. Using other clients isn't fully tested but in theory should work.

Configuration

Typically the only thing you need is to configure an api key, which you'll get from your easyship account interface. If you haven't made one yet, go to https://app.easyship.com/connect and look for API Integration near the bottom of the list.

For each integration you create, there will be two access tokens created, one that starts with prod_ and one that starts with sand_. The latter is your sandbox key and is the one you should use for testing and developing your integrations. It uses the same live endpoints but works off a separate set of test-only data.

The apiToken on the EasyshipAPI is optional, as a single customer may often be making api calls with different tokens.

Providing Request Options to the HTTP client

The EasyshipAPI constructor accepts an array of request options that will be merged into the options that are passed to the HTTP client when requests are sent to the API endpoints. See the guzzle request options documentation for possibilities.

Overriding the API host

For testing/development you may want to override the target host so that the calls you submit will be sent to your own server for inspection.

Webhooks

See WEBHOOKS.md.

Roadmap

Support

If you're getting unexpected results from your API calls, the most likely case is that your payload is not valid and you'll want to consult the Easyship reference docs. Note that you can plug values into the forms on that page, including your sandbox token, and run the tests from the interface. If you find an issue where the exact same call is working in Easyship's test page but failing with this library, please raise an issue with a very detailed explanation of the problem and include a copy of the exact code being run (at least the payload of test data being passed in) so that the issue can be easily reproduced. Please also include a copy of the incorrect response you're getting back.

License

This software was written by me, Justin Rebelo, and is released under the MIT license.

FORK just to reduce Guzzle to ^6.3


All versions of easyship-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
guzzlehttp/guzzle Version ^7.3
adhocore/jwt Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fhferreira/easyship-php contains the following files

Loading the files please wait ....