MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / onpurchase

Function onpurchase

src/lib/installPlugin.js:467–478  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

465 await helpers.promisify(iap.purchase, product.productId);
466
467 async function onpurchase(e) {
468 const purchase = await getPurchase(product.productId);
469 await fetch(Url.join(config.API_BASE, "plugin/order"), {
470 method: "POST",
471 body: JSON.stringify({
472 id: manifest.id,
473 token: purchase?.purchaseToken,
474 package: BuildInfo.packageName,
475 }),
476 });
477 purchaseToken = purchase?.purchaseToken;
478 }
479
480 async function onerror(error) {
481 throw error;

Callers

nothing calls this directly

Calls 1

getPurchaseFunction · 0.70

Tested by

no test coverage detected