def METHOD_NAME(
    mock_order_fully_refunded,
    mock_order_refunded,
    mock_order_updated,
    staff_api_client,
    permission_group_manage_orders,
    payment_txn_captured,
    monkeypatch,
):
    # given
    permission_group_manage_orders.user_set.add(staff_api_client.user)
    payment = payment_txn_captured
    payment.charge_status = ChargeStatus.FULLY_CHARGED
    payment.captured_amount = payment.total
    payment.save()
    payment_id = graphene.Node.to_global_id("Payment", payment.pk)
    variables = {"paymentId": payment_id, "amount": str(payment.total)}
    monkeypatch.setattr("saleor.payment.gateways.dummy.dummy_success", lambda: False)
    # when
    response = staff_api_client.post_graphql(REFUND_QUERY, variables)
    # then
    content = get_graphql_content(response)
    data = content["data"]["paymentRefund"]
    assert data["errors"] == [
        {
            "field": None,
            "message": "Unable to process refund",
            "code": PaymentErrorCode.PAYMENT_ERROR.name,
        }
    ]
    payment.refresh_from_db()
    assert payment.charge_status == ChargeStatus.FULLY_CHARGED
    assert payment.transactions.count() == 2
    txn = payment.transactions.last()
    assert txn.kind == TransactionKind.REFUND
    assert not txn.is_success
    assert not mock_order_fully_refunded.called
    assert not mock_order_refunded.called
    assert not mock_order_updated.called