onPurchase method
Implementation
void onPurchase(GlassfySku sku) async {
if (onPurchaseCallback != null) {
onPurchaseCallback!(sku);
} else {
try {
final transaction = await Glassfy.purchaseSku(sku);
onClose(transaction, null);
} catch (error) {
onClose(null, error);
}
GlassfyPaywall._listener = null;
GlassfyPaywall.close();
}
}