JSFiddle - React, Tailwind, and code Playground

by Yuriy Petrichenko

HTML

<script
  type="text/javascript"
  src="https://bootstrapper.primetrust-cdn.com/purchaseProtection.js"
  id="<id>"
  defer
></script>
<script type="text/javascript">
  console.log("[primetrust] 1. Loading Prime Trust Embedding API");

  window.onPurchaseProtectionReady = function (purchaseProtection) {
    console.log("[primetrust] 2. Loading embedded account creation...");
    purchaseProtection
      .start3DS({
        amount: "<amount>",
        fundsTransferMethodId: "<fundsTransferMethodId>",
      })
      .then((challengeId) => console.log("3ds succesfull id: ", challengeId))
      .catch((err) => console.log("Err: ", err));
  };

  // or

  window.primeTrustReady = function (pt) {
    console.log("[primetrust] 2. Loading embedded account creation...");
    pt.start3DS({
      amount: "<amount>",
      fundsTransferMethodId: "<fundsTransferMethodId>",
    })
      .then((challengeId) => console.log("3ds succesfull id: ", challengeId))
      .catch((err) => console.log("Err: ", err));
  };
</script>