diff --git a/index.php b/index.php index 970f7d0..f386937 100644 --- a/index.php +++ b/index.php @@ -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, @@ -30,5 +30,5 @@ 'confirm'=>true ]); -print_r($directCharge); +// print_r($directCharge); // Consider using logging instead diff --git a/src/PaysgatorClient.php b/src/PaysgatorClient.php index ae8682b..01dbb0b 100644 --- a/src/PaysgatorClient.php +++ b/src/PaysgatorClient.php @@ -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;