<s> import stripe <EOL> from . import charges <EOL> from . . import utils <EOL> def create ( charge , amount = None ) : <EOL> """<STR_LIT>""" <EOL> if amount is None : <EOL> stripe . Refund . create ( charge = charge . stripe_id ) <EOL> else : <EOL> stripe . Refund . create ( <EOL> charge = charge . stripe_id , <EOL> amount = utils . convert_amount_for_api ( charges . calculate_refund_amount ( charge , amount = amount ) , charge . currency ) <EOL> ) <EOL> charges . sync_charge_from_stripe_data ( charge . stripe_charge ) </s>
