1. Go to this page and download the library: Download useepay/useepay-php 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/ */
useepay / useepay-php example snippets
UseePay\UseePayClient;
use UseePay\Model\Authentication\Authentication;
use UseePay\Net\ApiEnvironment;
// Initialize authentication
$authentication = new Authentication(
'YOUR_MERCHANT_NO',
'YOUR_APP_ID',
'YOUR_API_KEY'
);
// Create client (Production)
$client = new UseePayClient($authentication);
// Or use Sandbox environment
$client = UseePayClient::withEnvironment(
ApiEnvironment::SANDBOX,
$authentication
);
use UseePay\Param\Customer\CustomerListParams;
$params = new CustomerListParams();
$params->limit = 10;
$params->startingAfter = null;
$customers = $client->customers()->list($params);
foreach ($customers['data'] as $customer) {
echo $customer['email'] . "\n";
}
use UseePay\UseePay;
// Disable SSL verification (NOT recommended for production)
UseePay::setVerifySslCerts(false);
// Set custom CA bundle path
UseePay::setCaBundlePath('/path/to/cacert.pem');
use UseePay\UseePay;
// Set connection timeout (default: 6 seconds)
UseePay::setConnectTimeout(30);
// Set read timeout (default: 30 seconds)
UseePay::setReadTimeout(60);
// Set max network retries (default: 0)
UseePay::setMaxNetworkRetries(3);