def calculate_refund_amount(self, amount=None):
        eligible_to_refund = self.amount - (self.amount_refunded or 0)
        if amount:
            amount_to_refund = min(eligible_to_refund, amount)
        else:
            amount_to_refund = eligible_to_refund
        return int(amount_to_refund * 100)
:rtype: int
dataset/ETHPy150Open pydanny/dj-stripe/djstripe/stripe_objects.py/StripeCharge.calculate_refund_amount