Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #16 from lonely-porcupine/master
Browse files Browse the repository at this point in the history
Add listCancellations
  • Loading branch information
mtymek authored Oct 8, 2018
2 parents 482bc50 + 7e28cb9 commit 9154237
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions src/Cleeng/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,35 @@ public function listTransactions($criteria = array(), $offset = 0, $limit = 20)
);
}

/* List Cancellations API: listCancellations
*
* @param array $criteria
* @param int $offset
* @param int $limit
*
* @return Cleeng_Entity_Base
*/

public function listCancellations($criteria = array(), $offset = 0, $limit = 20)
{
$collection = new Cleeng_Entity_Collection('Cleeng_Entity_Base');
$publisherToken = $this->getPublisherToken();
if (!$publisherToken) {
throw new Cleeng_Exception_RuntimeException("Cannot call " . __FUNCTION__ . ": setPublisherToken must be used first.");
}

return $this->api(
'listCancellations',
array(
'publisherToken' => $publisherToken,
'criteria' => $criteria,
'offset' => $offset,
'limit' => $limit,
),
$collection
);
}

/**
* @param array $criteria
* @param int $offset
Expand Down
2 changes: 1 addition & 1 deletion src/Cleeng/Entity/Cancellation.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @link http://developers.cleeng.com/v3/Reference/Reporting_API
*/
class Cleeng_Entity_Transaction extends Cleeng_Entity_Base
class Cleeng_Entity_Cancellation extends Cleeng_Entity_Base
{

protected $criteria;
Expand Down

0 comments on commit 9154237

Please sign in to comment.