forked from apoloz/alfa-bank-sdk
fix(formating)
This commit is contained in:
@@ -5,14 +5,14 @@ declare(strict_types=1);
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use Apoloz\AlfaBank\AlfaBank;
|
||||
use Apoloz\AlfaBank\Requests\Auth\RefreshClientSecretRequest;
|
||||
use Apoloz\AlfaBank\Enums\Environment;
|
||||
use Apoloz\AlfaBank\Requests\Auth\RefreshClientSecretRequest;
|
||||
|
||||
/**
|
||||
* UTILITY SCRIPT: Generate a Client Secret using your TLS certificates.
|
||||
*
|
||||
*
|
||||
* Run this ONCE when setting up the project or if you lose your secret.
|
||||
*
|
||||
*
|
||||
* Requirements:
|
||||
* 1. You have the `client_id` (Found in Developer Portal -> App Settings URL or Overview).
|
||||
* 2. You have the TLS certificates (.pem/.key) authorized by the bank.
|
||||
@@ -22,7 +22,7 @@ use Apoloz\AlfaBank\Enums\Environment;
|
||||
|
||||
// 1. Configuration
|
||||
$certPath = __DIR__ . '/certs/transport.crt'; // Your mTLS certificate
|
||||
$keyPath = __DIR__ . '/certs/transport.key'; // Your mTLS private key
|
||||
$keyPath = __DIR__ . '/certs/transport.key'; // Your mTLS private key
|
||||
$clientId = 'YOUR_CLIENT_ID_UUID'; // E.g. '0cee0683-85ae-...'
|
||||
|
||||
// 2. Initialize Connector (No Login required yet)
|
||||
@@ -41,20 +41,20 @@ try {
|
||||
|
||||
// 4. Output Result
|
||||
$data = $response->dto(); // Returns ClientSecretData
|
||||
|
||||
|
||||
echo "\n-------------------------------------------------------\n";
|
||||
echo "SUCCESS! New Client Secret Generated:\n";
|
||||
echo "-------------------------------------------------------\n";
|
||||
echo "Client ID: " . $data->clientId . "\n";
|
||||
echo "Client Secret: " . $data->clientSecret . "\n";
|
||||
echo 'Client ID: ' . $data->clientId . "\n";
|
||||
echo 'Client Secret: ' . $data->clientSecret . "\n";
|
||||
echo "-------------------------------------------------------\n";
|
||||
echo "IMPORTANT: Save this to your .env file immediately.\n";
|
||||
echo "It will not be shown again.\n";
|
||||
|
||||
} catch (\Exception $e) {
|
||||
echo "\nERROR: Could not generate secret.\n";
|
||||
echo "Message: " . $e->getMessage() . "\n";
|
||||
echo 'Message: ' . $e->getMessage() . "\n";
|
||||
if (method_exists($e, 'getResponse')) {
|
||||
echo "Response: " . $e->getResponse()->body() . "\n";
|
||||
echo 'Response: ' . $e->getResponse()->body() . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user