forked from apoloz/alfa-bank-sdk
39 lines
854 B
PHP
39 lines
854 B
PHP
<?php
|
|
|
|
namespace Apoloz\AlfaBank\Requests\NominalAccounts\Payouts;
|
|
|
|
use Saloon\Contracts\Body\HasBody;
|
|
use Saloon\Enums\Method;
|
|
use Saloon\Http\Request;
|
|
use Saloon\Http\Response;
|
|
use Saloon\Traits\Body\HasJsonBody;
|
|
|
|
class PayoffAcceptRequest extends Request implements HasBody
|
|
{
|
|
use HasJsonBody;
|
|
|
|
protected Method $method = Method::PATCH;
|
|
|
|
public function __construct(
|
|
protected string $payoffId,
|
|
protected bool $accept = true
|
|
) {}
|
|
|
|
public function resolveEndpoint(): string
|
|
{
|
|
return "/api/na/jp/v1/payoffs/{$this->payoffId}/accept";
|
|
}
|
|
|
|
protected function defaultBody(): array
|
|
{
|
|
return [
|
|
'accept' => $this->accept,
|
|
];
|
|
}
|
|
|
|
public function createDtoFromResponse(Response $response): bool
|
|
{
|
|
return (bool)($response->json('result') ?? false);
|
|
}
|
|
}
|