PHP code example of quickpay / quickpay-php-client
1. Go to this page and download the library: Download quickpay/quickpay-php-client 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/ */
quickpay / quickpay-php-client example snippets
8
use QuickPay\QuickPay;
try {
$client = new QuickPay();
} catch (Exception $e) {
//...
}
8
use QuickPay\QuickPay;
try {
$api_key = 'xxx';
$client = new QuickPay(":{$api_key}");
} catch (Exception $e) {
//...
}
8
// Get the HTTP status code, headers and raw response body.
list($status_code, $headers, $response_body) = $client->request->get('/payments')->asRaw();
// Get the response body as an object
$response_body = $client->request->get('/payments')->asObject();
// Get the response body as an array
$response_body = $client->request->get('/payments')->asArray();
// Example usage
$payments = $client->request->get('/payments')->asArray();
foreach($payments as $payment) {
//...
}
8
QuickPayAPI::$timeout = 30;
QuickPayAPI::$onTimeout ??= function () {
event(new PaymentGatewayTimeout($this));
throw new TimeoutException("No response from Quickpay within " . QuickPayAPI::$timeout . " seconds");
};
{
" "quickpay/quickpay-php-client": "2.0.*"
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.