In App Purchase Trouble

I’ve coded iap into my game and I seem to get the same output from what I’ve tried doing everytime. It will ask me for my itunes password to confirm purchase, but my console log outputs:

Cannot connect to iTunes Store

I am using testflight and apple’s beta testing features and my provisioning profiles have in app purchases enabled, am i able to test iap on testflight? If so, any clue why I’m not getting a connection to the iTunes Store?

Update: Please ask me if you need any answers/clarifications.