Ibn Ezra on Devarim 2:29 offers two possible explanations:
as the children of Es̀av did for me Some commentators relate this
phrase to “you will sell me food for money” [: 28], but if this be so,
how can they reconcile it with the inhabitants of Ar, who are
Moabites, and of whom Scripture says “because they did not approach
you …” [23: 5]? They feel constrained to give this interpretation,
though, because the king of Edom said, “you shall not pass through me”
[Numbers 20: 18]. In my opinion, the phrase refers back to the request
that we go along the main highway, as the children of Es̀av did for me
— i.e., they let them go around Mount S̀eir along the main highway.
Scripture accordingly related, “You are to pass along the border of
your kinsmen, the Children of Es̀av, who dwell in S̀eir” [: 4].
However, the king of Edom did not let them pass through by way of his
territory (from which point they would have been close to the land of
Canaan), so they went on to Ar — as it is written [: 18]. Many others
have proposed that, although “they did not approach you” [23: 5],
nevertheless Israel did purchase from the Moabites. (Shachter/Sefaria Translation)