Good afternoon GemGarnet,
Welcome to the Apple Support Communities!
I uderstand you are having trouble signing into iTunes on your Mac. Are you being prompted to sign in to the iTunes Store after attempting a purchase? Since you are able to sign in to your Apple ID on your iPhone, I would take a look at the iTunes software and billing/account details initially.
What version of iTunes do you have on your Mac? Click the link below to update to the most recent version of iTunes.
Update to the latest version of iTunes
If you are currently signed in, sign out of the iTunes Store on your Mac and restart your computer to refresh it.
Create, manage, and use an Apple ID
Launch Safari and sign in to your Apple ID account with the password that is working on your iPhone.
Check the billing details for your account. Check to make sure the billing address matches what you have on your bank statement. You may need to enter the card expiration date and CVV code again. Once you have verified everything is updated, click Done and log out of the Apple ID website.
Open iTunes and sign in with the Apple ID account and password that you just verified.
Sign in to the App Store and iTunes Store on your iPhone, iPad, iPod touch, Mac, PC, or Apple TV
Please reply to this thread and let us know if you are able to access your iTunes Store account after trying these steps.
Take care.