I don't see any details about the payment problem you are having. If you want help, you need to provide information.
This document explains how to add a payment method to your Apple ID on a Mac, Apple mobile devices, PC, or online ➔ Add a payment method to your Apple ID - Apple Support
On an iPhone or iPad (note that the details may vary slightly depending upon which iOS version you are running) :
1. Open the Settings app.
2. Tap your name.
3. Tap Media & Purchases (or Payment & Shipping). You might be asked to sign in with your Apple ID.
4. Tap Manage Payments. Depending upon the iOS version you use you might not see this step.
5. Tap Add Payment Method. Enter the new payment method, then tap Done.
Apple's official support articles present multiple statements* about situations requiring the presence of a payment method at times, even for free items. You do not always have to have one, but if you are encountering one of those situations then you have no option but to enter a valid payment method if you wish to continue downloading. The payment method may not be charged if you also have account balance or the item is free, but the payment method has to be present. You might even be able to remove it again immediately once Apple has seen it.
This next article lists valid payment methods for different countries but note that in this situation Apple Account balance alone apparently may not meet the requirement and you need to use another payment method until you find one that satisfies Apple's requirement (often a credit or debit card): Payment methods that you can use with your Apple ID - Apple Support .
If you have already entered a payment method, use the “Add a payment method” link above to check it. If a message appears in red there is a problem with it. If the information is still correct and current, contact your financial institution. Also check this resource --> If your payment method is declined in the App Store or iTunes Store - Apple Support
* Ref.:
Add a payment method to your Apple ID - Apple Support
"To make purchases from the App Store and use subscriptions like iCloud+ and Apple Music, you need at least one payment method on file."
If you can’t download or update apps on your iPhone or iPad - Apple Support
- "You might need to have a payment method on file, even if the app that you want to download is free."
Remove a payment method from your Apple ID - Apple Support
- If you have any active subscriptions, you must have at least one payment method on file other than Apple ID credit.
- You might not be able to remove a payment method if you have a balance due.
Sign in with your Apple ID - Apple Support
- "When you sign in to the App Store and other media services for the first time, you might need to add a credit card or other payment information."
How apps, content, and subscriptions from Apple are billed - Apple Support
- You can’t charge gifts to your Apple ID balance. If you send a gift or gift card, your primary payment method is charged.
- Some subscriptions might not be charged to your Apple ID balance.
What you can buy with your Apple Gift Card or Apple Account balance - Apple Support
"Some purchases might require that you have a credit card on file, even if you use your Apple Account balance to make the purchase."