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

Method onpurchase

src/lib/acode.js:618–629  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

616 });
617
618 async function onpurchase(e) {
619 const purchase = await getPurchase(product.productId);
620 await fetch(Url.join(config.API_BASE, "plugin/order"), {
621 method: "POST",
622 body: JSON.stringify({
623 id: remotePlugin.id,
624 token: purchase?.purchaseToken,
625 package: BuildInfo.packageName,
626 }),
627 });
628 purchaseToken = purchase?.purchaseToken;
629 }
630
631 async function onerror(error) {
632 throw error;

Callers

nothing calls this directly

Calls 1

getPurchaseFunction · 0.70

Tested by

no test coverage detected