<s> from . Base import * <EOL> from Mollie . API . Error import * <EOL> from Mollie . API . Object import Payment , Refund <EOL> class Payments ( Base ) : <EOL> RESOURCE_ID_PREFIX = '<STR_LIT>' <EOL> def getResourceObject ( self , result ) : <EOL> return Payment ( result ) <EOL> def get ( self , payment_id ) : <EOL> if not payment_id or self . RESOURCE_ID_PREFIX not in payment_id : <EOL> raise Error ( <EOL> '<STR_LIT>' % ( payment_id , self . RESOURCE_ID_PREFIX ) <EOL> ) <EOL> return super ( Payments , self ) . get ( payment_id ) <EOL> def refund ( self , payment ) : <EOL> return self . client . payment_refunds . on ( payment ) . create ( ) <EOL> class Refunds ( Base ) : <EOL> payment_id = None <EOL> def getResourceObject ( self , result ) : <EOL> return Refund ( result ) <EOL> def getResourceName ( self ) : <EOL> return '<STR_LIT>' % self . payment_id <EOL> def on ( self , payment ) : <EOL> self . payment_id = payment [ '<STR_LIT:id>' ] <EOL> return self </s>
