Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function showPayment(planId, callback) {
try {
await RNIap.prepare();
await RNIap.getSubscriptions([planId]);
const purchase = await RNIap.buySubscription(planId);
callback(null, purchase);
} catch (err) {
callback(err, null);
} finally {
await RNIap.endConnection();
}
}