Add support for looking up coupon redemption on an invoice

API v2 now supports looking up the coupon redemption that's been
applied to an invoice. It also adds a 'state' attribute, since
redemptions applied to an invoice might be inactive.

Acked-by: Stephen Celis <stephen@recurly.com>
Signed-off-by: Evan Owen <kainosnoema@gmail.com>
Added cgi require to js.rb
Merge pull request #78 from recurly/require-cgi

Added cgi require to js.rb
Support resource marshaling

Money and pagers can't serialize procs [fix #81].

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Support subdomain configuration

Configuring the client by subdomain is required from now.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Merge pull request #1 from recurly/route-api-by-subdomain

Support subdomain configuration
update broken link in README
use https for github repo link in README
Properly instantiate subscription add-ons

Subscription add-ons were being memoized improperly and were using Money
objects (instead of integers). By memoizing in the attributes hash and
ensuring that integers are used, the XML will properly generate.

This fixes #85.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Fix module scoping issue

By dynamically setting constants when scopes or associations were
created, it was causing more trouble than it was worth, especially when
libraries were available that defined the same constant name in a global
scope.

This fixes #76.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Don't set subscription add-ons to an array

This causes a problem in XML serialization.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Because `ruby -recurly`

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Remove superfluous setter

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
pending_subscription should return a Subscription

This fixes #83.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Expose transaction errors on transaction

This fixes #79.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Surface Transaction::Error#transaction_error_code

This fixes #73.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Only build master and v2-stable

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Fix Nokogiri interpretation of empty nodes

Nokogiri::Element returns the number of nodes when you call
children#each, leading to text returning 0 if there are none. Instead,
let's join the texts together and return that ("" instead in that last
case).

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Only reject procs on marshal dump

Pagers can be marshalled.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Update year

Signed-off-by: Stephen Celis <stephen@stephencelis.com>