diff --git a/CHANGELOG.md b/CHANGELOG.md index cd91a319..e6d789d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * [#153](https://github.com/recurly/recurly-client-php/pull/153) * Added `ip_address` attribute to `Recurly_Transaction`[#157](https://github.com/recurly/recurly-client-php/pull/157) * Added `bank_account_authorized_at` to `Recurly_Subscription` [#156](https://github.com/recurly/recurly-client-php/pull/156) +* Add invoice node to `Recurly_PushNotification` to read data on *_invoice_notification [#159](https://github.com/recurly/recurly-client-php/pull/159) ## Version 2.4.2 (Apr 14th, 2015) diff --git a/lib/recurly/push_notification.php b/lib/recurly/push_notification.php index eaad7d89..b3463927 100644 --- a/lib/recurly/push_notification.php +++ b/lib/recurly/push_notification.php @@ -21,27 +21,31 @@ class Recurly_PushNotification * failed_payment_notification * successful_refund_notification * void_payment_notification + * new_invoice_notification + * closed_invoice_notification + * past_due_invoice_notification */ var $type; var $account; var $subscription; var $transaction; + var $invoice; function __construct($post_xml) { $this->parseXml($post_xml); } - + function parseXml($post_xml) { if (!@simplexml_load_string ($post_xml)) { return; } $xml = new SimpleXMLElement ($post_xml); - + $this->type = $xml->getName(); - + foreach ($xml->children() as $child_node) { switch ($child_node->getName()) @@ -55,6 +59,9 @@ function parseXml($post_xml) case 'transaction': $this->transaction = $child_node; break; + case 'invoice': + $this->invoice = $child_node; + break; } } }