Apple pay payment error 'Cannot connect to iTunes store'

We're using sandbox for testing auto renewing IAP but most of the time it's returning error saying 'Cannot connect to iTunes store'.

Payment was working before in sandbox, but for some reason it just stopped working.

Because of this issue, we cannot submit our app for approval.

We already posted this issue in the developer forum about this, but no clear response of the cause of the issue and the solution about it. We also noticed many developers posted the same issue, which you can see in this link: https://developer.apple.com/forums/thread/98763

We've been struggling with this issue more than 4 weeks ago and we are really stuck here, so we need your help as this is already causing delays on our client deliverables.


There are many reasons for this error message. One is that you are trying to access the production environment, not the sandbox environment, because you loaded a version from Xcode over an earlier 'app store' version of your app rather than deleting that earlier version.
Apple pay payment error 'Cannot connect to iTunes store'
 
 
Q