Praise be to Allah.
This is a kind of gambling, concerning which Allaah says (interpretation of the meaning):
“O you who believe! Intoxicants (all kinds of alcoholic drinks), gambling, al-ansaab (stone altars for making sacrifices to idols, etc.) and al-azlaam (arrows for seeking luck or decision) are an abomination of Shaytaan’s handiwork. So avoid (strictly all) that (abomination)…” [al-Maa’idah 5:90]
Gambling means everything that involves one side trying to take advantage of the other, so that one will be the winner and the other will be the loser. This is the shar’i ruling on gambling. So a man who pays 500 riyals every month, for example, may buy books for which his discount adds up to more than a thousand riyals, or he may not buy anything at all. If we suppose that he buys things for which the discount adds up to more than five hundred riyals, then he will be the winner, and the storekeeper will be the loser; if he does not buy anything, then the storekeeper will be the winner and the man will be the loser, because he paid 500 riyals and did not get anything in return. This transaction is a kind of gambling and is not permissible.