purchase static method
Initiates purchase of a given product ID.
Logs an error if the purchase fails.
Implementation
static Future<void> purchase(String productId) async {
try {
final product = findProductDetails(productId);
if (product != null) {
await _iap.buyNonConsumable(
purchaseParam: PurchaseParam(productDetails: product),
);
}
} catch (e) {
LoggerUtil.d('Error during purchase: $e');
}
}