Download the PHP package ecommercegeeks/myparcel-sdk without Composer

On this page you can find all versions of the php package ecommercegeeks/myparcel-sdk. 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 myparcel-sdk

A Saloon based PHP SDK for MyParcel

The official SDK for MyParcel contains many smart features that in practice get in the way more than help. So we developed this dumb SDK.

This SDK stays close to the API documentation. DTOs and Enums are used where it makes sense. This SDK is light on documentation, because autocomplete will show you the way.

Usage

Installation

Creating a label

For more usage examples, have a look at the tests in the tests/Feature folder.

Be careful

This is a dumb SDK, so this SDK doesn't check correctness of the data. You have to take into account that the MyParcel service is also lenient on data errors. You can easily create a label for a non-existent address. When you delete non-existing shipments, MyParcel doesn't respond with an error.

Implemented requests

Request Endpoint dto() Description
AddShipment POST /shipments
GetShipments GET /shipments
UpdateShipment PATCH /shipments
DeleteShipment DELETE /shipments
GetLocations GET /locations array of locations Endpoint is limited to NL
MatchLocations GET /locations/match -
GetShipmentLabels GET /shipment_labels

Testing

Testing is performed against the actual API. Copy test.example.env to test.env and enter your API key. Then execute the test suite by running ./vendor/bin/pest. Because the tests are executed against the actual API, no CI/CD is in place.

Feature tests

The feature tests in the tests/Feature folder go through a cycle where a shipment is created and then either updated or deleted. All feature tests either delete or hide the shipments after the cycle.

Contributing

When you find an endpoint which is not implemented yet you are invited to add the required classes to this SDK through a pull request. Take the following in order:

Request classes

All DTO arguments are provided through the constructor. We use one class for both the request and the response, when arguments are not required for a request, or not always present in responses, these arguments are default null so should be last in the argument list of the constructor.

Tests

Because tests are performed against the production API, make sure that tests delete or hide all created shipments.

When you are working in the test suite, you can display the sent request and response by setting $this->debug = true within the test.


All versions of myparcel-sdk with dependencies

PHP Build Version
Package Version
Requires saloonphp/saloon Version ^3.0
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 ecommercegeeks/myparcel-sdk contains the following files

Loading the files please wait ....