How to prevent unlocking products for TestFlight beta testers

Hey, I'm adding in-app purchases to an app. I'm using consumable products and tiering all my products into specific tiers (products A, B, C will be part of tier 1 with a specific price, products D, E, F will be part of tier 2 with another price, etc).

The process of unlocking a given product is handled on the backend. Once a purchase is done via IAP on the app, I'm sending the StoreKit 2 JWS representation of the transaction along with the product so that my server unlocks this product to this user.

Do I need to call Get Transaction History at this point for extra verification?

Also, how do I prevent my app's beta users (who install the app via test flight) from purchasing the products for free (since test flight in app purchases are for free, as they're done via a Sandbox user)?

If you are validating the signature, perhaps with the App Store Server Library, it is not necessary to call any endpoints server-to-server. As to the environment, in the App Store Server Library (https://developer.apple.com/documentation/appstoreserverapi/simplifying_your_implementation_by_using_the_app_store_server_library), you pass which environment you are verifying and if it doesn't match verification will fail, or you can check the environment field yourself in https://developer.apple.com/documentation/appstoreserverapi/jwstransactiondecodedpayload

How to prevent unlocking products for TestFlight beta testers
 
 
Q