forked from apoloz/alfa-bank-sdk
42 lines
926 B
PHP
42 lines
926 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Apoloz\AlfaBank\Requests\Aff;
|
|
|
|
use Apoloz\AlfaBank\Data\Aff\AffSignData;
|
|
use Apoloz\AlfaBank\Data\Shared\GeneralStatusData;
|
|
use Saloon\Contracts\Body\HasBody;
|
|
use Saloon\Enums\Method;
|
|
use Saloon\Http\Request;
|
|
use Saloon\Http\Response;
|
|
use Saloon\Traits\Body\HasJsonBody;
|
|
|
|
class SignRegisterRequest extends Request implements HasBody
|
|
{
|
|
use HasJsonBody;
|
|
|
|
protected Method $method = Method::POST;
|
|
|
|
public function __construct(
|
|
protected AffSignData $data
|
|
) {}
|
|
|
|
public function resolveEndpoint(): string
|
|
{
|
|
return '/api/aff/jp/v1/registers/sign';
|
|
}
|
|
|
|
public function createDtoFromResponse(Response $response): GeneralStatusData
|
|
{
|
|
return GeneralStatusData::from([
|
|
'success' => $response->successful(),
|
|
]);
|
|
}
|
|
|
|
protected function defaultBody(): array
|
|
{
|
|
return $this->data->toArray();
|
|
}
|
|
}
|