Download the PHP package stefan-ghivi/php-test without Composer
On this page you can find all versions of the php package stefan-ghivi/php-test. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-test
MANGOPAY PHP SDK
MangopaySDK is a PHP client library to work with Mangopay REST API.
Compatibility Notes
- Since v2.1 of this SDK, you must be using at least v2.01 of the API (more information about the changes required)
- If you experience problems with authentification and/or the temporary token file following an SDK update (particuarly updating to v2.0 of the SDK), you may need to just delete your temporary file (that you specify with
$api->Config->TemporaryFolder
) - which allows it to be regenerated correctly the next time it's needed
Requirements
To use this SDK, you will need (as a minimum):
- PHP v5.4
- cURL (included and enabled in a standard PHP distribution)
- OpenSSL (included and enabled in a standard PHP distribution)
- psr/log v1.0
- You do not have to use Composer, but you are strongly advised to (particularly for handling the dependancy on the PSR Log library)
Installation with Composer
You can use Mangopay SDK library as a dependency in your project with Composer (which is the preferred technique). Follow these installation instructions if you do not already have Composer installed. A composer.json file is available in the repository and it has been referenced from Packagist.
The installation with Composer is easy and reliable:
Step 1 - Add the Mangopay SDK as a dependency by executing the following command:
you@yourhost:/path/to/your-project$ composer require mangopay/php-sdk-v2:^2.3
Step 2 - Update your dependencies with Composer
you@yourhost:/path/to/your-project$ composer update
Step 3 - Finally, be sure to include the autoloader in your project
require_once '/path/to/your-project/vendor/autoload.php';
The Library has been added into your dependencies and is ready to be used.
Installation without Composer
The project attempts to comply with PSR-4 specification for autoloading classes from file paths. As a namespace prefix is MangoPay\
with base directory /path/to/your-project/
.
If you're not using PSR-4 or Composer, the installation is as easy as downloading the library and storing it under any location that will be available for including in your project (don't forget to include the required library dependencies though):
Alternatively you can download the package in its entirety (ie with all required dependencies) from the Releases page (look for the mangopay2-php-sdk-[RELEASE_NAME].zip
file).
Uncompress the zip file you download, and include the autoloader in your project:
License
MangopaySDK is distributed under MIT license, see the LICENSE file.
Unit Tests
Tests are placed under /path/to/your-project/tests/
.
The /tests/suites/all.php
suite runs ALL tests.
You can also use any of /tests/cases/*.php
to run a single test case.
Contacts
Report bugs or suggest features using issue tracker on GitHub.
Account creation
You can get yourself a free sandbox account or sign up for a production account (note that validation of your production account can take a few days, so think about doing it in advance of when you actually want to go live).
Configuration
Using the credential info from the signup process above, you should then set $api->Config->ClientId
to your Mangopay ClientId and $api->Config->ClientPassword
to your Mangopay passphrase.
You also need to set a folder path in $api->Config->TemporaryFolder
that SDK needs
to store temporary files. This path should be outside your www folder.
It could be /tmp/
or /var/tmp/
or any other location that PHP can write to.
You must use different folders for your sandbox and production environments.
$api->Config->BaseUrl
is set to sandbox environment by default. To enable production
environment, set it to https://api.mangopay.com
.
Sample usage
Sample usage with Composer in a Symfony project
You can integrate Mangopay features in a Service in your Symfony project.
MangoPayService.php :
Logging
MangoPay uses the PSR3 LoggerInterface. You can provide your own logger to the API. Here is a sample showing Monolog integration :