1. Go to this page and download the library: Download paylike/php-api 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/ */
$paylike = new \Paylike\Paylike($private_api_key);
try {
$transactions = $paylike->transactions();
$transactions->capture($transaction_id, array(
'amount' => 100,
'currency' => 'EUR'
));
} catch (\Paylike\Exception\NotFound $e) {
// The transaction was not found
} catch (\Paylike\Exception\InvalidRequest $e) {
// Bad (invalid) request - see $e->getJsonBody() for the error
} catch (\Paylike\Exception\Forbidden $e) {
// You are correctly authenticated but do not have access.
} catch (\Paylike\Exception\Unauthorized $e) {
// You need to provide credentials (an app's API key)
} catch (\Paylike\Exception\Conflict $e) {
// Everything you submitted was fine at the time of validation, but something changed in the meantime and came into conflict with this (e.g. double-capture).
} catch (\Paylike\Exception\ApiConnection $e) {
// Network error on connecting via cURL
} catch (\Paylike\Exception\ApiException $e) {
// Unknown api error
}
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.