-
Notifications
You must be signed in to change notification settings - Fork 193
/
Copy pathSettlementCaptureEndpoint.php
63 lines (53 loc) · 1.88 KB
/
SettlementCaptureEndpoint.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
declare(strict_types=1);
namespace Mollie\Api\Endpoints;
use Mollie\Api\Resources\Capture;
use Mollie\Api\Resources\CaptureCollection;
use Mollie\Api\Resources\LazyCollection;
class SettlementCaptureEndpoint extends CollectionEndpointAbstract
{
protected $resourcePath = "settlements_captures";
/**
* @inheritDoc
*/
protected function getResourceObject()
{
return new Capture($this->client);
}
protected function getResourceCollectionObject($count, $_links)
{
return new CaptureCollection($this->client, $count, $_links);
}
/**
* Retrieves a collection of Settlement Captures from Mollie.
*
* @param string $settlementId
* @param string|null $from The first capture ID you want to include in your list.
* @param int|null $limit
* @param array $parameters
*
* @return mixed
* @throws \Mollie\Api\Exceptions\ApiException
*/
public function pageForId(string $settlementId, ?string $from = null, ?int $limit = null, array $parameters = [])
{
$this->parentId = $settlementId;
return $this->rest_list($from, $limit, $parameters);
}
/**
* Create an iterator for iterating over captures for the given settlement id, retrieved from Mollie.
*
* @param string $settlementId
* @param string $from The first resource ID you want to include in your list.
* @param int $limit
* @param array $parameters
* @param bool $iterateBackwards Set to true for reverse order iteration (default is false).
*
* @return LazyCollection
*/
public function iteratorForId(string $settlementId, ?string $from = null, ?int $limit = null, array $parameters = [], bool $iterateBackwards = false): LazyCollection
{
$this->parentId = $settlementId;
return $this->rest_iterator($from, $limit, $parameters, $iterateBackwards);
}
}