alpha_full/admin/options/mangPay.scripts/mangoPay.appel.php
2026-04-06 22:58:51 +02:00

30 lines
1.2 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
// https://github.com/Mangopay/mangopay2-php-sdk
include ('vendor/autoload.php');
// voir D:\7Prod\wwwroot\Sites\include\vendor\mangopay\php-sdk-v2\demos pour exemples
try {
// create object to manage MangoPay API
$api = new MangoPay\MangoPayApi();
// use test client credentails (REPLACE IT BY YOUR CLIENT ONES!)
$api->Config->ClientId = '123ventestest';
$api->Config->ClientPassword = 'uUL1kvDMDP05Kth6snU5Caj83c3TNgTJyXqguMZcgp7n2CaA9t'; //api key
$api->Config->TemporaryFolder = '/tmp/';
// GET USERS LIST: GET /users
$pagination = new MangoPay\Pagination(1, 8);
$users = $api->Users->GetAll($pagination);
// display result on screen
MangoPay\Libraries\Logs::Debug('PAGINATION OBJECT', $pagination);
MangoPay\Libraries\Logs::Debug('LIST WITH USERS', $users);
}
catch (MangoPay\Libraries\ResponseException $e) {
MangoPay\Libraries\Logs::Debug('MangoPay\ResponseException Code', $e->GetCode());
MangoPay\Libraries\Logs::Debug('Message', $e->getMessage());
MangoPay\Libraries\Logs::Debug('Details', $e->GetErrorDetails());
}
catch (MangoPay\Libraries\Exception $e) {
MangoPay\Libraries\Logs::Debug('MangoPay\Exception Message', $e->getMessage());
}
?>