Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
'base_url' => 'https://paysgator.com/api/v1/', // Optional, defaults to production
]);

$apiKey="";
$walletId="";
$apiKey = getenv('PAYSGATOR_API_KEY') ?: '';
$walletId = getenv('PAYSGATOR_WALLET_ID') ?: '';

// Authenticate to get a new token (automatically sets it on the client)
$response = $client->auth()->authenticate($apiKey, $walletId);
$token = $response['accessToken'];

//Genrating a direct charge
// Generating a direct charge

$directCharge = $client->paymentLinks()->create([
'amount' => 0.01,
Expand All @@ -30,5 +30,5 @@
'confirm'=>true
]);

print_r($directCharge);
// print_r($directCharge); // Consider using logging instead

2 changes: 1 addition & 1 deletion src/PaysgatorClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Paysgator;

use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;

use Paysgator\Resources\Payments;
use Paysgator\Resources\Subscriptions;
use Paysgator\Resources\Transactions;
Expand Down