monei / monei-php-sdk
The MONEI SDK will allow you to interact with our API in an easy and predictable way.
Installs: 2 858
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 2
Open Issues: 2
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^9.6.13
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-04-27 11:07:36 UTC
README
The MONEI API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
This library is intended to help you develop an integration around our API, by using the MONEI PHP Client and it's methods.
Docs in our portal
You can find the complete information and details in our documentation portal.
Requirements
PHP 7.2 and later
Installation & Usage
Composer
To install the bindings via Composer, run the following command:
composer require monei/monei-php-sdk
Or add the following to composer.json
:
{ "require": { "monei/monei-php-sdk": "^1.2.0" } }
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/MONEI PHP SDK/vendor/autoload.php');
Tests
To run the unit tests:
composer install ./vendor/bin/phpunit
Authorization
The MONEI API uses API key to authenticate requests. You can view and manage your API key in the MONEI Dashboard.
For more information about this process, please refer to our documentation portal.
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Instantiate the client using the API key $monei = new Monei\MoneiClient('YOUR_API_KEY'); try { $result = $monei->payments->create([ 'amount' => 1250, // 12.50€ 'orderId' => '100100000001', 'currency' => 'EUR', 'description' => 'Items decription', 'customer' => [ 'email' => 'john.doe@monei.com', 'name' => 'John Doe' ] ]); print_r($result); } catch (Exception $e) { echo 'Error while creating payment: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
For more detailed information about this library and the full list of methods, please refer to our documentation portal.