<s> from libsaas import http , parsers <EOL> from libsaas . services import base <EOL> from . import resource <EOL> class TransactionsBase ( resource . RecurlyResource ) : <EOL> path = '<STR_LIT>' <EOL> def update ( self , * args , ** kwargs ) : <EOL> raise base . MethodNotSupported ( ) <EOL> def delete ( self , * args , ** kwargs ) : <EOL> raise base . MethodNotSupported ( ) <EOL> class Transactions ( TransactionsBase ) : <EOL> @ base . apimethod <EOL> def get ( self , state = None , type = None , cursor = None , per_page = None ) : <EOL> """<STR_LIT>""" <EOL> params = base . get_params ( <EOL> ( '<STR_LIT:state>' , '<STR_LIT:type>' , '<STR_LIT>' , '<STR_LIT>' ) , locals ( ) ) <EOL> request = http . Request ( '<STR_LIT:GET>' , self . get_url ( ) , params ) <EOL> return request , parsers . parse_xml <EOL> class Transaction ( TransactionsBase ) : <EOL> def create ( self , * args , ** kwargs ) : <EOL> raise base . MethodNotSupported ( ) <EOL> @ base . apimethod <EOL> def refund ( self , amount_in_cents = None ) : <EOL> """<STR_LIT>""" <EOL> self . require_item ( ) <EOL> url = self . get_url ( ) <EOL> params = base . get_params ( ( '<STR_LIT>' , ) , locals ( ) ) <EOL> if params : <EOL> url = url + '<STR_LIT:?>' + http . urlencode_any ( params ) <EOL> request = http . Request ( '<STR_LIT>' , url ) <EOL> return request , parsers . parse_empty <EOL> class AccountTransactions ( TransactionsBase ) : <EOL> def create ( self , * args , ** kwargs ) : <EOL> raise base . MethodNotSupported ( ) </s>
