@@ -174,11 +174,16 @@ def charge(self, charge):
174174 url = urljoin (self ._url , '%s/adjustments' % self .account_code )
175175 return charge .post (url )
176176
177- def invoice (self ):
177+ def invoice (self , ** kwargs ):
178178 """Create an invoice for any outstanding adjustments this account has."""
179179 url = urljoin (self ._url , '%s/invoices' % self .account_code )
180180
181- response = self .http_request (url , 'POST' )
181+ if kwargs :
182+ response = self .http_request (url , 'POST' , Invoice (** kwargs ), {'Content-Type' :
183+ 'application/xml; charset=utf-8' })
184+ else :
185+ response = self .http_request (url , 'POST' )
186+
182187 if response .status != 201 :
183188 self .raise_http_error (response )
184189
@@ -439,8 +444,18 @@ class Invoice(Resource):
439444 'created_at' ,
440445 'line_items' ,
441446 'transactions' ,
447+ 'terms_and_conditions' ,
448+ 'customer_notes' ,
442449 )
443450
451+ blacklist_attributes = (
452+ 'currency' ,
453+ )
454+
455+ def serializable_attributes (self ):
456+ return [attr for attr in self .attributes if attr not in
457+ self .blacklist_attributes ]
458+
444459 @classmethod
445460 def all_open (cls , ** kwargs ):
446461 """Return a `Page` of open invoices.
@@ -531,7 +546,9 @@ class Subscription(Resource):
531546 'collection_method' ,
532547 'po_number' ,
533548 'first_renewal_date' ,
534- 'bulk'
549+ 'bulk' ,
550+ 'terms_and_conditions' ,
551+ 'customer_notes' ,
535552 )
536553 sensitive_attributes = ('number' , 'verification_value' , 'bulk' )
537554
0 commit comments