Unexpected cancellation of food delivery orders poses significant challenges to resource allocation planning and could lead to reduced revenue for service providers. This paper addresses this issue by developing an optimization framework that can reassign canceled orders to alternative customers to maximize net revenue and minimize resource wastage. The problem is formulated as a route-based Markov decision process, named the Dynamic Routing and Pricing Problem with Cancellation (DRPPC). A solution approach based on the proximal policy optimization strategy is introduced as a computationally effective way of solving the optimization problem using reinforcement learning techniques. Experimental results demonstrate that the proposed computational method outperforms selected benchmark approaches with higher revenue from various kinds of scenarios with uncertainties. This research advances the intersection of urban logistics and reinforcement learning, offering actionable strategies for enhanced operational resilience in food delivery service providers.