In-app purchase on sandbox mode returns multiple transactions on same product id.
Language Used: Swift 4.0
func validateAppReceipt(_ receipt: Data) {
You are using auto renewable subscriptions. There will be one receipt for every auto-renew or renew of the subscription.
So generally, if subscription has renewed 5 times then there will be 5 receipts in the sandbox environment and 6 in real environment (production environment, downloaded from AppStore). Because an receipt is generated for the app downloaded or purchased from the AppStore as well.