39 lines
1011 B
PHP
39 lines
1011 B
PHP
<?php
|
|
|
|
namespace Apoloz\AlfaBank\Requests\NominalAccounts\Deals;
|
|
|
|
use Apoloz\AlfaBank\Data\NominalAccounts\Payouts\DigestSignatureData;
|
|
use Saloon\Contracts\Body\HasBody;
|
|
use Saloon\Enums\Method;
|
|
use Saloon\Http\Request;
|
|
use Saloon\Traits\Body\HasJsonBody;
|
|
use Spatie\LaravelData\DataCollection;
|
|
|
|
class DealActionRequest extends Request implements HasBody
|
|
{
|
|
use HasJsonBody;
|
|
|
|
protected Method $method = Method::PATCH;
|
|
|
|
public function __construct(
|
|
protected string $dealId,
|
|
protected string $action, // ACCEPT, COMPLETE, CANCEL
|
|
#[DataCollectionOf(DigestSignatureData::class)]
|
|
protected DataCollection $digestSignatures
|
|
) {}
|
|
|
|
public function resolveEndpoint(): string
|
|
{
|
|
return '/api/na/jp/v1/deals/action';
|
|
}
|
|
|
|
protected function defaultBody(): array
|
|
{
|
|
return [
|
|
'dealId' => $this->dealId,
|
|
'action' => $this->action,
|
|
'digestSignatures' => $this->digestSignatures->toArray(),
|
|
];
|
|
}
|
|
}
|