PHP code example of monei / monei-php-sdk

1. Go to this page and download the library: Download monei/monei-php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

monei / monei-php-sdk example snippets





nstantiate 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' => '[email protected]',
            'name' => 'John Doe'
        ]
    ]);
    print_r($result);
} catch (Exception $e) {
    echo 'Error while creating payment: ', $e->getMessage(), PHP_EOL;
}

bash
composer