Skip to content

makepay-io/makepay-modal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MakePay Modal

A small, domain-neutral browser embed for MakePay payment links and donations. The checkout host is always configured explicitly; it is never inferred from the script URL.

<script
  src="https://unpkg.com/@makecrypto/makepay-modal@latest/dist/makepay.min.js"
  data-api-url-prefix="https://your-checkout-host.example"
></script>
<button data-makepay-payment-link="PAYMENT_UID">Pay</button>

No initialization call is required when data-api-url-prefix is present. Advanced integrations can also call makepay.init, makepay.showPayment, makepay.showDonation, makepay.hideFrame, or makepay.setApiUrlPrefix.

Payment button

Create a payment link, copy its UID, and place it in data-makepay-payment-link:

<button type="button" data-makepay-payment-link="PAYMENT_UID">
  Pay with crypto
</button>

Use data-makepay-view-type="minimal" for compact checkout. The default is the full checkout.

Donation button

<button type="button" data-makepay-donation-slug="DONATION_SLUG">
  Donate with crypto
</button>

JavaScript API

makepay.showPayment("PAYMENT_UID", {
  viewType: "minimal",
  onEvent(event) {
    if (event.type === "makepay.payment.status") {
      console.log(event.payload);
    }
  },
});

Available methods include showPayment, showDonation, showFrame, hideFrame, init, configure, and setApiUrlPrefix.

Security model

The package contains no default checkout domain. It accepts lifecycle messages only from the exact origin configured through data-api-url-prefix or the programmatic API. The @latest URL follows the npm latest tag so merchants receive new modal releases without changing their embed code.

About

Configurable browser modal for MakePay payment links and donations

Resources

License

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors