noxxie/mailtopay-api

An PHP API interface for the Mailtopay API

0.1.3 2019-12-28 11:00 UTC

This package is auto-updated.

Last update: 2024-04-28 20:34:58 UTC


README

This package aims into making the interface between the MailtoPay API and PHP easier to use. This package can only be used with version 2 of the Mailtopay APi, version 1 is not supported and is deprecated by Mailtopay.

More information regarding the Mailtopay API can be found on the Mailtopay website.

This project is in open beta, please report any bugs using the issue tracker.

Requirements

  • PHP >= 5.3.7

Installation

composer require noxxie/mailtopay-api

After installation you can use any given endpoint class and use the client class to do the request. See the docs directory for more information regarding the endpoints.

Usage

See the docs directory for information for each endpoint. You can use the client class to do the actuall request.

use Noxxie\Mailtopay\Client;
...

$client = new Client('id', 'passphrase', 'base_uri', $endpoint);
$response = $client->execute();

The id, passphrase and base_uri are provided information from Mailtopay.

Validation

This package aims to validate any provided data as much as possible in order to give back invalid that where possible before the request is send to the API. When a invalid parameter is set a InvalidParameterException exception will be thrown.

However it is always possible that you enter some wierd combination of data that this package does not validate for. The API also does a validation check and when a error rises from the API an error response is returned. You can pick those up with the ResponseException exception.

tests

Running tests with phpunit

.\vendor\bin\phpunit

Versioning

We use SemVer for versioning.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details