One <script>, one button — a non-custodial stablecoin checkout you can drop on any website. Buyers pay USDC/USDT across 8 chains; funds settle straight to your wallet. HashPay never holds keys or funds.
cdn.hashpay.dev is the home of HashPay's embeddable checkout.
embed.js is a single, self-contained script (it inlines its own styles into a Shadow DOM, so it can't clash with — or be broken by — your site's CSS). You reference one of your Prices by id, and the widget pops an overlay checkout: the buyer picks a chain and token, sees the exact amount and a QR, and pays. HashPay watches the chain and confirms the payment in real time.
Money moves buyer → your wallet directly. HashPay never touches funds or keys.
The amount lives on the server against your Price — never in the buyer's browser.
Solana, Tron, Ethereum, Base, Arbitrum, Polygon, Avalanche, BNB Chain.
Styles are inlined & scoped — no leakage either way, drops onto any stack.
Paste the script once, then a button referencing one of your Prices.
<!-- 1. Load the widget once (anywhere on the page) -->
<script src="https://cdn.hashpay.dev/embed.js" data-pk="pk_live_your_publishable_key"></script>
<!-- 2. Any button that references a Price opens the checkout -->
<button data-hashpay-price="price_123abc">Pay with crypto</button>
That's it. data-pk is your publishable key (safe in the browser). Buttons with data-hashpay-price, data-hashpay-link, or data-hashpay-session are wired automatically.
<script src="https://cdn.hashpay.dev/embed.js"></script>
<script>
HashPay.checkout({
priceId: "price_123abc",
publishableKey: "pk_live_your_publishable_key",
metadata: { orderId: "order-42" }, // echoed back in your webhook
onClose: () => console.log("checkout closed")
})
</script>
pk_test_… key while integrating (test payments settle with a "Simulate" button, no crypto), then switch to pk_live_….The global is window.HashPay, exposed by embed.js.
| Attribute | On | Meaning |
|---|---|---|
data-pk | the <script> | Default publishable key for the page. |
data-hashpay-price | a button | Open checkout for a Price id. |
data-hashpay-link | a button | Open checkout for a Payment Link id. |
data-hashpay-session | a button | Open checkout for a server-created Checkout Session. |
data-hashpay-pk | a button | Override the publishable key for that button. |
data-hashpay-meta | a button | JSON metadata echoed back in your webhook — pass your order id here. |
data-hashpay-mode | a button | "inline" renders in-page instead of the modal overlay. |
data-hashpay-container | a button | Element id to render into (required with data-hashpay-mode="inline"). |
| Option | Type | Notes |
|---|---|---|
priceId / paymentLinkId / sessionId | string | Exactly one — what the buyer is paying for. |
publishableKey | string | Your pk_… key. Falls back to the script's data-pk. |
metadata | object | Your own context (order id, customer id…), echoed back unchanged in the payment webhook. Pass it so your webhook consumer can find its order. |
mode | string | "modal" (default) or "inline" — inline flows inside your page, no overlay. |
container | string | Element id to render into. Required when mode is "inline". |
apiBase | string | Optional. Defaults to the script's origin + /api/v1. |
onClose | function | Called when the buyer dismisses the checkout. |