1. Go to this page and download the library: Download kubinyete/pagseguro-edi library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Creates a new paginator for any transactional movements from today, fetching every page with size 500
$paginator = $client->getTransactionalMovements(date: new DateTime('now'), pageSize: 500);
// Iterating over every page available
foreach ($paginator as $item) {
// You can also manually configure or extract attributes from our paginator object
echo "Found movement code {$item->getMovimentoApiCodigo()} on page {$paginator->getPage()}/{$paginator->getTotalPages()}" . PHP_EOL;
}
// Manually fetching first page
$paginator->setPage(1);
$items = $paginator-getItems();
// Increment +1 page
$paginator->incrementPage();
$items = $paginator-getItems();
// Decrement -1 page
$paginator->decrementPage();
$items = $paginator-getItems();
// Manually iterating (without an iterator)
while ($items = $paginator->nextItems()) {
echo "Found movement code {$item->getMovimentoApiCodigo()} on page {$paginator->getPage()}/{$paginator->getTotalPages()}" . PHP_EOL;
}
// Creates a new paginator for any finantial movements from today, fetching every page with size 500
$paginator = $client->getFinantialMovements(date: new DateTime('now'), pageSize: 500);
// Iterating over every page available
foreach ($paginator as $item) {
// You can also manually configure or extract attributes from our paginator object
echo "Found movement code {$item->getMovimentoApiCodigo()} on page {$paginator->getPage()}/{$paginator->getTotalPages()}" . PHP_EOL;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.