فَلَيْسَ لِلَّهِ حَاجَةٌ is a short nominal construction introduced by a defective verb:
لَيْسَ — a verb used to negate a statement.
لِلَّهِ — “for Allah”; a preposed prepositional phrase related to the predicate of laysa.
حَاجَةٌ — “a need,” the delayed subject (ism) of laysa.
The statement does not suggest that Allah possesses a human need. It strongly warns that moral restraint belongs to the purpose of fasting.
In فِي أَنْ يَدَعَ, the verb follows أَنْ and means “in his giving up.”