forked from apoloz/alfa-bank-sdk
first commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Gemini\AlfaBank\Requests\NominalAccounts\Beneficiaries;
|
||||
|
||||
use Gemini\AlfaBank\Data\NominalAccounts\Beneficiaries\BeneficiaryTransactionCollectionData;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
|
||||
class GetBeneficiaryTransactionsRequest extends Request
|
||||
{
|
||||
protected Method $method = Method::GET;
|
||||
|
||||
public function __construct(
|
||||
protected string $beneficiaryId,
|
||||
protected string $dateFrom,
|
||||
protected string $dateTo,
|
||||
protected ?int $limit = 100,
|
||||
protected ?int $offset = 0
|
||||
) {}
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return "/api/na/jp/v1/beneficiaries/{$this->beneficiaryId}/transactions";
|
||||
}
|
||||
|
||||
protected function defaultQuery(): array
|
||||
{
|
||||
return [
|
||||
'dateFrom' => $this->dateFrom,
|
||||
'dateTo' => $this->dateTo,
|
||||
'limit' => $this->limit,
|
||||
'offset' => $this->offset,
|
||||
];
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): BeneficiaryTransactionCollectionData
|
||||
{
|
||||
return BeneficiaryTransactionCollectionData::from($response->json());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user