-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #699 from sandervanhooft/add_settlement_dedicated_…
…subresource_endpoints Add settlement dedicated subresource endpoints
- Loading branch information
Showing
8 changed files
with
478 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mollie\Api\Endpoints; | ||
|
||
use Mollie\Api\Resources\Capture; | ||
use Mollie\Api\Resources\CaptureCollection; | ||
|
||
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mollie\Api\Endpoints; | ||
|
||
use Mollie\Api\Resources\Chargeback; | ||
use Mollie\Api\Resources\ChargebackCollection; | ||
|
||
class SettlementChargebackEndpoint extends CollectionEndpointAbstract | ||
{ | ||
protected $resourcePath = "settlements_chargebacks"; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function getResourceObject() | ||
{ | ||
return new Chargeback($this->client); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function getResourceCollectionObject($count, $_links) | ||
{ | ||
return new ChargebackCollection($this->client, $count, $_links); | ||
} | ||
|
||
/** | ||
* Retrieves a collection of Settlement Chargebacks from Mollie. | ||
* | ||
* @param string $settlementId | ||
* @param string|null $from The first chargeback 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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Mollie\Api\Endpoints; | ||
|
||
use Mollie\Api\Resources\Refund; | ||
use Mollie\Api\Resources\RefundCollection; | ||
|
||
class SettlementRefundEndpoint extends CollectionEndpointAbstract | ||
{ | ||
protected $resourcePath = "settlements_refunds"; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function getResourceCollectionObject($count, $_links) | ||
{ | ||
return new RefundCollection($this->client, $count, $_links); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function getResourceObject() | ||
{ | ||
return new Refund($this->client); | ||
} | ||
|
||
/** | ||
* Retrieves a collection of Settlement Refunds from Mollie. | ||
* | ||
* @param string $settlementId | ||
* @param string|null $from The first refund 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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.