1. Go to this page and download the library: Download cashela/payin 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/ */
cashela / payin example snippets
Cashela\PayIn\CashelaPayIn;
use Cashela\PayIn\CashelaApiError;
$client = new CashelaPayIn([
'environment' => 'sandbox', // dev|staging|sandbox|production
'apiKey' => $_ENV['CASHELA_API_KEY'],
'apiSecret' => $_ENV['CASHELA_API_SECRET'],
]);
try {
$countries = $client->listCountries();
$deposit = $client->createDeposit(
['external_identifier' => 'order-123', /* ... */],
idempotencyKey: 'order-123' // sent only on creation; never retry this call
);
} catch (CashelaApiError $e) {
// $e->status is the HTTP status, $e->raw is the decoded error envelope
error_log("Cashela API error {$e->status}: {$e->getMessage()}");
}