Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Resource/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Moip\Resource;

use ArrayIterator;
use Requests;
use stdClass;

Expand Down Expand Up @@ -169,6 +170,16 @@ public function getId()
{
return $this->getIfSet('id');
}

/**
* Get releases associated with the request.
*
* @return ArrayIterator
*/
public function getEventIterator()
{
return new ArrayIterator($this->data->events);
}

/**
* Mount payment structure.
Expand All @@ -192,6 +203,7 @@ protected function populate(stdClass $response)
$payment->data->payments = $this->getIfSet('payments', $response);
$payment->data->escrows = $this->getIfSet('escrows', $response);
$payment->data->fees = $this->getIfSet('fees', $response);
$payment->data->events = $this->getIfSet('events', $response);
$payment->data->refunds = $this->getIfSet('refunds', $response);
$payment->data->_links = $this->getIfSet('_links', $response);
$payment->data->createdAt = $this->getIfSetDateTime('createdAt', $response);
Expand Down