The fact that restarting the device cleared the issue would seem to indicate that the failure may have been caused by the state of iOS on the device at the time of the attempted purchases. I'd say that this was a bug report issue. If this issue were to happen on a device here at Apple, StoreKit engineering would ask for a sysdiagnose archive with the StoreKit profile installed. However this is not feasible to advise a user to do, especially after the fact.
It appears that the app's updatedTransactions delegate method is being called with the SKPaymentTransactionStateFailed (SKPaymentTransactionState.failed) result. When this happens, the app can check the SKPaymentTransaction.error which in this case is 0, an unspecified error occurred. When the app gets the localized description for this error (0), it translates to "Cannot connect to iTunes Store". What this means is that some unspecified error occurred, which isn't a helpful result.
If it turns out that if you (or some developer can replicate this failure) here's the instructions for installing the StoreKit profile and for triggering a sysdiagnose archive.
Here are the instructions to install the StoreKit profile
Install StoreKit profile to an iOS 11+ device
Please login to the Apple Developer Bug Report - Profiles and Logs website
<https://developer.apple.com/bug-reporting/profiles-and-logs/> using Safari on the device you will use to replicate the problem with.
Click the “Profile” URL associated with the “App Store/iTunes Store for iOS” item. You will download the “itmsdebugging.mobileconfig” file.
For iOS 12.2 or later, you will open the Settings app -> General -> Profiles & Device Management -> iTunes and App Stores Diagnostic logging -> press Install
For devices with less than iOS 12.2, - PLEASE RESTART THE DEVICE
CAPTURE THE DEVICE CONSOLE LOG - connect the device to a macOS X Sierra system (macOS X 10.12.x or newer)
1. Launch the Console app on the macOS system, and select the device in the left side of the Console window
2. Before starting the iOS app, click “Clear”.
3. Start the application and perform the steps to replicate the problem.
4. When the issue occurs, save the contents of the Console log
Check the contents of the console log for the string “fetchSoftwareAddOns”. If this string is not present in the log, the profile was not active. Please re-install the StoreKit profile and make sure to restart the device.
To trigger the sysdiagnose archive on an iOS device
1. Press and hold the Volume Up, Volume Down and Sleep buttons at the same time, then release. On an iPhone, there will be a slight vibration. There won't be any haptic feedback if done on an iPad.
2. Wait approximately 5 minutes
3. Open the Settings app -> Privacy > Analytics > Analytics Data
4. Select the "sysdiagnose_" file and share via AirDrop to a Mac.
Note the file will be extremely large. Developers can open a bug report at https://feebackassistant.apple.com. The Apple Developer Bug Report URL will accept large enclosures with the bug report.
rich kubota - rkubota@apple.com
developer technical support CoreOS/Hardware/MFI