unable to complete the test transaction, using Store Kit frame work (wrapped in c++) and a test user account.

Hey All,
I just set up in app purchase for my game using the StoreKit ,wrapped in c++. When I purchase a product in my game,
it asks for the iTune credentials. I put my test user accounts credentials. Then it tells , that its Sandbox environment and asks to tap buy. On tapping buy , it redirects to the iTunes, there again it asks for the credentials , I again fill the info and it further tells this is sandbox environment , I touch continue , then it either says “Cannot connect to iTunes” or prompts for the credentials again.

I have already tried:

  1. Signing out of the iTunes in my device.
  2. Creating a new test account.[ for Indian store].
  3. Uninstalling the app from the device and installing again.
    But still no way! Does anyone knows what I might be missing.

EDIT: I just observed that on tapping buy , first time , the transaction fails, logging the message to the console. And its description says same thing “Cannot connect to iTunes Store”