Skip to content

Commit

Permalink
add invoice notification node
Browse files Browse the repository at this point in the history
  • Loading branch information
francois committed Jun 2, 2015
1 parent f6fe53d commit 6f7a406
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/recurly/push_notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,29 @@ class Recurly_PushNotification
* failed_payment_notification
* successful_refund_notification
* void_payment_notification
* *_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())
Expand All @@ -55,6 +57,9 @@ function parseXml($post_xml)
case 'transaction':
$this->transaction = $child_node;
break;
case 'invoice':
$this->invoice = $child_node;
break;
}
}
}
Expand Down

0 comments on commit 6f7a406

Please sign in to comment.