fix xml generation for nested resources (accounts specifically)

    - when a resource has no unsaved keys, still send required keys when nested
    - also fix some failing tests

Now we can do this (makes little sense, but if account has already been loaded, it can be helpful):

    $subscription = new Recurly_Subscription();
    $subscription->plan_code = 'small';
    $subscription->currency = 'USD';
    $subscription->account = Recurly_Account::get( 'sample_account_code' );
    $subscription->create();
Merge pull request #29 from recurly/fix_nested_resource_xml

Create subscriptions/transactions with existing accounts
support the 'first_renewal_date' attribute for subscriptions
Those functions have to comply with the methods in the "Recurly_Resource" class for PHP 5.3.6. to not throw the "... should be compatible with that of ..." error message.
Add subscription postpone functionality

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Support marking invoices successful/failed

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Fix un-pageable array results (no href is present), such as invoice/transactions

Certain nested array results are not always part of a pageable collection, so when
we parse them into a Recurly_Pager object, we need to pre-load the _count property
so we can iterate properly.

In order to properly implement this, an accurate count of XML node->childNodes was
required, which was being thrown off because we weren't ignoring whitespace nodes.
This change then required a slight rewrite of the parser.

Acked-by: Stephen Celis <stephen@recurly.com>
Signed-off-by: Evan Owen <kainosnoema@gmail.com>
Merge pull request #36 from recurly/fix_parsing_for_pager

Fix un-pageable array results (no href is present), such as invoice/transactions
Transaction refund API route was changed to DELETE /v2/transactions/:uuid

The old route was deprecated some time ago, but somehow this client lib
wasn't updated. I'll be attempting to keep it current from now on.

In addition to changing the refund route, we're now parsing any responses
that might be returned by DELETE requests, as is the case with refunding
transactions.

Signed-off-by: Evan Owen <kainosnoema@gmail.com>
Alias transaction void() to refund(), add deprecation notice

Signed-off-by: Evan Owen <kainosnoema@gmail.com>
Merge pull request #38 from recurly/fix-transaction-refunding

Transaction refund API route was changed to DELETE /v2/transactions/:uuid
v2.1.2 -- Bumped version and updated changelog

Signed-off-by: Evan Owen <kainosnoema@gmail.com>
Merge pull request #35 from rubenmueller/patch-1

Update Recurly_SubscriptionAddOn overrides to match Recurly_Resource signatures
Implemented the Countable interface on Recurly_ErrorList.  See <http://php.net/manual/en/class.countable.php> for more info.
Implemented IteratorAggregate on Recurly_ErrorList.
See <http://www.php.net/manual/en/class.iteratoraggregate.php> for details.
Implements the Countable and InteratorAggregate interfaces on
Recurly_CurrencyList as requested by @kainosnoema.
Fix updating currency lists on loaded resources, such as plans

Fixes an issue where updating a specific currency on a previously
loaded resource wouldn't take affect. Because the currency list
is neither an array nor updates the unsavedAttrs array on the parent,
it wasn't being persisted. This checks if the attr in question is
either an array or implements ArrayAccess, in which case it's
persisted automatically.

Signed-off-by: Evan Owen <kainosnoema@gmail.com>
Merge pull request #39 from recurly/fix-update-currency-lists

Fix updating currency lists on loaded resources, such as plans
Add the 'accounting_code' attribute to AddOns and Transactions

Signed-off-by: Evan Owen <kainosnoema@gmail.com>
Add missing API methods on addon, account_list