Apple Pay is not an account that holds any money, so not sure if you meant you added funds to your Apple Account. If that is what you did and you now have the funds in the Apple Account to pay for the previous purchase then:
- On your iPhone or iPad, open the Settings app and tap your name.
- Tap Media & Purchases, then tap View Account.
- Tap Purchase History.
- Tap the order with red text that says Amount You Owe.
- Tap Pay with Apple Account Credit.
The payment method used for App Store purchases is what you have in your Apple Account settings. This is where you want to look for the cards being used and the order that they will use to process a payment. The Apple Account will always be on the top of the list and will be the first to deduct any amount, with the remaining being billed to the next one on the list and you can change the order of those cards. If you meant you added money to Apple Cash, then make sure that card is on the list so it can be used for purchases in the App Store.
If you need to change or update your Apple Account payment method - Apple Support
This is the other support article for resolving the problem with a previous purchase. Notice there is no reference to Apple Pay or the Wallet app.
If a message says 'billing problem with previous purchase' or 'verification required' - Apple Support