<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rocketfellows / tinkoff-invest-v1-method-get-dividends example snippets
/**
* @throws SourceFaultException
* @throws IncorrectInputsFaultException
*/
public function getAll(string $figi): Dividends;
/**
* @throws SourceFaultException
* @throws IncorrectInputsFaultException
*/
public function getBeforeDate(string $figi, DateTime $dateTime): Dividends;
/**
* @throws IncorrectInputsFaultException
* @throws SourceFaultException
*/
public function getByPeriod(string $figi, DateTime $fromDateTime, DateTime $toDateTime): Dividends;
/**
* @throws IncorrectInputsFaultException
* @throws SourceFaultException
*/
public function requestAll(string $figi): Dividends;
/**
* @throws IncorrectInputsFaultException
* @throws SourceFaultException
*/
public function requestToDate(string $figi, DateTime $toDateTime): Dividends;
/**
* @throws IncorrectInputsFaultException
* @throws SourceFaultException
*/
public function requestByPeriod(string $figi, DateTime $fromDateTime, DateTime $toDateTime): Dividends;
$client = new \rocketfellows\TinkoffInvestV1RestClient\Client(
(
new \rocketfellows\TinkoffInvestV1RestClient\ClientConfig(
'https://invest-public-api.tinkoff.ru/rest',
<your_access_token>
)
),
new \GuzzleHttp\Client()
);
$instrumentsService = new \rocketfellows\TinkoffInvestV1InstrumentsRestClient\InstrumentsService($client);
$dividendsRequestService = new \rocketfellows\TinkoffInvestV1MethodGetDividends\adapters\rest\DividendsRequestService($instrumentsService);
$dividends = $dividendsService->getByPeriod(
'BBG004730RP0',
new DateTime('2022-05-24T15:38:52.283Z'),
new DateTime('2022-08-24T15:38:52.283Z'),
);
var_dump($dividends);