You're tossing us several issues at once so here's a bunch of links addressing these:
If your payment method is declined in the App Store or iTunes Store - various reasons why payment method is declined. - https://support.apple.com/HT203005 You may need to contact your bank and ask them if there is a problem with your card. Apple may just be passing on a message.
About needing a card: You need a card if you have a subscription or if you owe money for something. "Learn why you can't use your Apple ID without a payment method in the App Store, iTunes Store, and more." - https://support.apple.com/HT203905
About the code: Get a verification code and sign in with two-factor authentication - https://support.apple.com/HT204974
There may be some things Apple simply cannot answer such as if your bank is having a problem with your account and refusing payment. Otherwise you really need to contact Apple again if the links don't answer your questions. We are just users like you and definitively can't do much other than point you in the right direction.
iTunes and App Stores support --> https://support.apple.com/en-euro/itunes-contact
or:
Contact - Official Apple Support --> https://support.apple.com/contact
or:
Contact Apple for support and service --> "See a list of Apple phone numbers around the world." - https://support.apple.com/HT201232