def METHOD_NAME(request: RefundRequest) -> None:
    """Automatically process a refund request if possible.
    Current limitations:
        - Only supports Stripe (so far)
        - Issues a full refund (minus donation) for every refund request without a note.
          We need to add a way for people to request which tickets to partially refund.
          (issue #900)
        - Only refunds in the currency of payment.
    Will raise a ManualRefundRequired exception if a payment cannot be automatically refunded.
    """
    payment = request.payment
    if request.method != "stripe":
        raise ManualRefundRequired("Manual refund required for non-Stripe refund")
    if request.note is not None and request.note != "":
        raise ManualRefundRequired("Refund request has note")
    # Mark payment as "refunding" - this allows us to ignore refund webhooks which arrive before
    # we're finished here. Stripe's webhooks can be very quick.
    payment.state = "refunding"
    db.session.commit()
    payment.lock()
    refund_amount = payment.amount - request.donation
    app.logger.info(
        f"Handling automatic refund request {request.id} for {payment.provider} {payment.id}. "
        f"Refund amount {refund_amount} {payment.currency}. "
        f"Donation amount {request.donation} {payment.currency}. "
    )
    refund = None
    if refund_amount > 0:
        refund = create_stripe_refund(
            payment, refund_amount, metadata={"refund_request": request.id}
        )
    with db.session.no_autoflush:
        for purchase in payment.purchases:
            purchase.refund_purchase(refund)
    # TODO: set partrefunded state if we have not refunded the whole payment
    payment.state = "refunded"
    db.session.commit()
    send_refund_email(request, refund_amount)