refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
35
src/Requests/B2B_1C/CheckMerchantRequest.php
Normal file
35
src/Requests/B2B_1C/CheckMerchantRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Apoloz\AlfaBank\Requests\B2B_1C;
|
||||
|
||||
use Apoloz\AlfaBank\Data\B2B_1C\MerchantData;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
|
||||
class CheckMerchantRequest extends Request
|
||||
{
|
||||
protected Method $method = Method::GET;
|
||||
|
||||
public function __construct(
|
||||
protected string $merchantId,
|
||||
protected string $auth1C // Basic auth string
|
||||
) {}
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return "/api/1c/merchants/{$this->merchantId}";
|
||||
}
|
||||
|
||||
protected function defaultHeaders(): array
|
||||
{
|
||||
return [
|
||||
'Authorization-1C' => $this->auth1C,
|
||||
];
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): MerchantData
|
||||
{
|
||||
return MerchantData::from($response->json());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user