You have to pay upfront. Even if the application is unsuccessful, many people in the agency have worked hard, and of course there will be a fee. The official fees, that is, the fees of the patent office, will naturally be charged more, because a lot of people have to work to review your patent application documents. If you don’t charge for unqualified patents, how much work will be in vain? ah? You know, there are definitely many more people who are not authorized than those who are authorized.