forked from apoloz/alfa-bank-sdk
refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Apoloz\AlfaBank\Sbp\SbpConnector;
|
||||
use Apoloz\AlfaBank\Core\AlfaConfig;
|
||||
use Apoloz\AlfaBank\Sbp\Requests\GetQrCodeRequest;
|
||||
use Apoloz\AlfaBank\Sbp\Data\QrCodeRequestData;
|
||||
use Saloon\Http\Faking\MockResponse;
|
||||
@@ -15,11 +16,16 @@ test('can generate static qr code', function () {
|
||||
], 200),
|
||||
]);
|
||||
|
||||
$connector = new SbpConnector('cert.pem', 'key.pem', 'key-alias');
|
||||
$config = new AlfaConfig(
|
||||
baseUrl: 'https://test.com',
|
||||
certificatePath: __DIR__ . '/../../test_key.pem',
|
||||
privateKeyPath: __DIR__ . '/../../test_key.pem'
|
||||
);
|
||||
$connector = new SbpConnector($config, 'key-alias');
|
||||
$connector->withMockClient($mockClient);
|
||||
|
||||
$payload = new QrCodeRequestData(
|
||||
TermNo: 'test-term',
|
||||
termNo: 'test-term',
|
||||
amount: '100'
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user