<button id="button">Pay N1000</button>

document.addEventListener("DOMContentLoaded", function (event) {
        const onload = (args) => {
          console.log({ args });
        };
        const onclose = (args) => {
          console.log("yayay i was closed");
        };
        const onsuccess = (args) => {
          console.log({ args });
        };
        const fc = new Fluidcoins({
          amount: 100000,
          metadata: {
            yaga: "oops",
            key: "value",
            moniker: "horus"
          },
          email: "your-email-address@gmail.com",
          key: "pk_test_3d3c8d84245842918664a1554720dbcc", // can switch to your live public key. Neve use your Secret key :) 
          //name: "Customer name", // This is optional
          onLoad: onload,
          onClose: onclose,
          onSuccess: onsuccess,
        });
        fc.setup();

        const button = document.getElementById("button");
        button.addEventListener("click", function () {
          fc.open();
        });
      });

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://js.fluidcoins.com/pay.js