1. Go to this page and download the library: Download paykrypt/paykrypt-php-sdk 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/ */
$paykrypt->paymentIntents->retrieve('pi_...');
$paykrypt->paymentIntents->list(['page' => 1, 'limit' => 20]);
$paykrypt->paymentIntents->cancel('pi_...');
$paykrypt->payouts->create([
'amount' => '95',
'currency' => 'USDT',
'destinationAddress' => 'TXYZ...',
'chainId' => 'tron',
]);
$paykrypt->payouts->stats();
$paykrypt->refunds->create([
'paymentIntentId' => '00000000-0000-0000-0000-000000000000',
'amount' => '50.00',
'reason' => 'Customer requested refund',
]);
$paykrypt->webhooks->register([
'url' => 'https://example.com/webhooks/paykrypt',
'events' => ['payment.confirmed.v1'],
]);
// What was actually sent to your endpoints, what they answered, and which attempt it was.
$paykrypt->webhooks->deliveries(['limit' => 20, 'paymentIntentId' => 'pi_...']);
$paykrypt->addressBook->create([
'label' => 'Treasury wallet',
'address' => 'TXYZ...',
'chainId' => 'tron',
]);
$paykrypt->conversions->preview([
'fromAssetId' => 1,
'toAssetId' => 2,
'amount' => 10,
]);
$paykrypt->currencies->list();
$paykrypt->assets->list();
$paykrypt->assets->listByChain('tron');
$paykrypt->pricing->rates(['currency' => 'USD', 'symbols' => ['BTC', 'ETH', 'USDT']]);
$paykrypt = new PayKryptClient(['apiKey' => getenv('PAYKRYPT_TEST_KEY')]);
if (!$paykrypt->isTestMode()) {
throw new RuntimeException('Refusing to run tests against a live key');
}
$intent = $paykrypt->paymentIntents->create(['amount' => '25.00', 'currency' => 'USD']);
$paykrypt->test->pay($intent['id'], [
'scenario' => 'confirm',
'chainId' => 'tron',
'assetSymbol' => 'USDT',
]);
$paykrypt->test->expire($intent['id']);
// A sandbox payout waits in `pending` exactly as a real one does. Drive the outcome:
$paykrypt->test->completePayout($payout['id'], ['outcome' => 'confirmed']);
$paykrypt->test->completeRefund($refund['id'], [
'outcome' => 'rejected',
'reason' => 'Insufficient hot wallet balance',
]);