import { getCurrentWindow } from '@electron/remote';
import WindowsIapWrapper from 'windows-iap-wrapper';
const getStoreContext = () => {
const context = new WindowsIapWrapper();
let hwnd = getCurrentWindow().getNativeWindowHandle();
const initialized = context.initialize(hwnd);
if (!initialized) return null;
return context;
};
const StoreContext = getStoreContext();
const product = await StoreContext.getAssociatedStoreProductAsync(['Durable'], identifier);
const result = await StoreContext.requestPurchaseAsync(product.storeId);