It is understood that one cannot command God nor treat him as a vending machine. However, what can be said regarding the balance of having faith and receiving versus not receiving?
Although this question acknowledges the error of treating God as a “vending machine,” this concept still seems to be hidden underneath. Indeed, we are encouraged to “ask not wavering.” But we should not think of a “balance.” Rather we need to take into account the motive for asking.
Familiar verses in John 14 are helpful: “And whatsoever ye shall ask in my name, this will I do, that the Father may be glorified in the Son. If ye shall ask anything in my name, I will do it” (vv. 13–14, KJV).
In the context of these verses, the Lord is speaking of oneness with the Father and loving Himself and keeping His commandments. Fellowship with the ways and character of the Father and Son is being emphasized. Also, we are to ask in His name. This is not just tacking on the phrase to the end of our prayers, but recognizing His authority and character in what we ask.
In summary, if we have the mind of the Lord about a situation, we will be asking for what He can approve according to His character and will. The issue is not how earnestly we may desire a thing (which is often mistaken for “faith”), but whether we are walking in His commandments.