"Pay with crypto" option
A ready-made 'Pay with crypto' row for your own list of payment methods, beside Card and PayPal: a React component, a plain HTML/CSS version, and the logo pack.
import { PaymentMethodOption } from "@intents-fi/react";
<PaymentMethodOption selected={method === "crypto"} onSelect={() => setMethod("crypto")} />Your checkout already lists Card and PayPal. This is the row that goes next to them: a radio labelled Pay with crypto, the USDT, USDC, ETH, SOL and BTC marks with a count, and the line “Any token, any network”. While it is selected, a short explainer sits under it: the exact price, how long it holds, and the automatic refund. It sits in your page and takes your page’s font. For an express-checkout row there is a button, and for a footer “We accept crypto”.
Selecting it does not take a payment. When the customer confirms the order:
- your server creates the invoice with
createInvoice, using your order id asreference; - your page opens the payment pop-up with that invoice:
<PayButton>or<CheckoutEmbed>in React, orIntentsCheckout.open()anywhere else (widget); - your server ships the order on the
invoice.paidwebhook, and only then. The pop-up’sonPaidis for your page (close it, show a thank-you); anyone can fire it from a browser console.
"use client";import { CheckoutEmbed, PaymentMethodOption } from "@intents-fi/react";import { useState } from "react";
export function PaymentMethods({ orderId }: { orderId: string }) { const [method, setMethod] = useState<"card" | "paypal" | "crypto">("card"); const [invoice, setInvoice] = useState<{ id: string; clientSecret: string } | null>(null);
async function placeOrder() { if (method !== "crypto") return; // your card and PayPal flow // Your route: calls createInvoice({ amount, reference: orderId }) and returns id + clientSecret. const res = await fetch("/api/crypto-invoice", { method: "POST", body: JSON.stringify({ orderId }) }); setInvoice(await res.json()); }
return ( <fieldset> <legend>Payment method</legend> <label><input type="radio" name="payment-method" checked={method === "card"} onChange={() => setMethod("card")} /> Card</label> <label><input type="radio" name="payment-method" checked={method === "paypal"} onChange={() => setMethod("paypal")} /> PayPal</label> <PaymentMethodOption selected={method === "crypto"} onSelect={() => setMethod("crypto")} amount="$49.00" /> <button type="button" onClick={placeOrder}> {method === "crypto" ? "Pay $49.00 with crypto" : "Place order"} </button> {invoice ? ( <CheckoutEmbed invoiceId={invoice.id} clientSecret={invoice.clientSecret} onPaid={() => location.assign("/thanks")} /> ) : null} </fieldset> );}It is a native radio inside a label, so it joins your group when it has the same name
(payment-method by default), and the keyboard and screen readers treat it like your other rows.
| Prop | Default | |
|---|---|---|
selected |
false |
checked: the filled radio, the soft ground and the explainer |
onSelect |
called when the customer picks it | |
disabled |
false |
dimmed and not selectable, e.g. under the $1.00 minimum; say why in subtitle (“Available on orders over $1.00”), which stays readable |
name, value |
payment-method, crypto |
the radio’s group and value |
theme |
light |
dark, or auto to follow the visitor’s system setting |
subtitle |
“Any token, any network” | false hides it |
more |
1000 |
the “+N” after the marks; false hides it |
explainer |
true |
the short explainer under the selected row; false leaves it out |
amount |
the order total as you show it (“$49.00”): “You pay exactly $49.00” | |
lockMinutes |
30 |
how long the price holds: your invoices’ expiresInSec / 60 |
appearance |
colorText, colorTextMuted, colorBackground, colorBackgroundHover, colorBorder, colorAccent, fontFamily, borderRadius |
Text colours must keep 4.5:1 contrast against the background, and colorAccent (the selected
radio and the focus ring) 3:1. colorBackgroundHover is the hovered and selected ground, and the
explainer’s. A colour that fails is refused and the default is kept; you get the
reason in onAppearanceError, or as a console warning.
Plain HTML and CSS
Section titled “Plain HTML and CSS”For sites without React. Load the stylesheet once, and put the row in your list:
<link rel="stylesheet" href="https://pay.intents.fi/v1/option.css">
<div class="ifpm-Item"><label class="ifpm-Option ifpm-Option--light"> <input class="ifpm-Radio" type="radio" name="payment-method" value="crypto"> <span class="ifpm-Text"> <span class="ifpm-Label">Pay with crypto</span> <span class="ifpm-Subtitle">Any token, any network</span> </span> <span class="ifpm-Icons" aria-hidden="true"><img src="https://pay.intents.fi/v1/brand/token-marks.svg" width="80" height="20" alt=""><span class="ifpm-More">+1,000</span></span></label><div class="ifpm-Explainer ifpm-Explainer--light"> <p>Pay with USDT, USDC, ETH, SOL and 1,000+ other tokens, from your wallet or an exchange. You'll choose how to pay in the next step.</p> <p class="ifpm-Note"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true" focusable="false"><path d="M5 12l5 5L19 7"/></svg><span>You pay the exact order total. The price is locked for 30 minutes.</span></p> <p class="ifpm-Note"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true" focusable="false"><path d="M5 12l5 5L19 7"/></svg><span>If anything goes wrong, you're refunded automatically.</span></p></div></div>Use the same name as your other payment radios. The selected style and the explainer need no
JavaScript. Keep the label and the explainer together in .ifpm-Item, and put your order total in it: replace
“You pay the exact order total.” with You pay exactly <b>$49.00</b>. If your invoices expire
sooner than 30 minutes, change that number too. Leave the explainer out if you’d rather not show it. Swap
--light for --dark or --auto on both elements. To use your own colours, set
the custom properties on the row and check their contrast yourself:
.ifpm-Option, .ifpm-Explainer, .ifpm-Express, .ifpm-Accept { --ifpm-text: #14213d; --ifpm-accent: #0e5a8a; --ifpm-radius: 12px; --ifpm-font: inherit; /* the default: your page's font */}Then, when the order is placed with this row selected, create the invoice on your server and open the pop-up:
<script src="https://pay.intents.fi/v1/checkout.js"></script><script> // invoice = { id, clientSecret } from your server's createInvoice IntentsCheckout.open({ invoiceId: invoice.id, clientSecret: invoice.clientSecret, onPaid: () => location.assign("/thanks"), // the page only: ship on the invoice.paid webhook });</script>In a narrow row the strip shortens to two marks, then to the count alone, so the words never wrap into it.
The colours default to the checkout’s own tokens (--c-bg, --c-ink, --c-muted, --c-rule,
--c-soft, --c-accent), so a page that sets those restyles every piece at once.
The express button
Section titled “The express button”For an express-checkout row, next to Apple Pay and PayPal. It is a plain button. On click, your page asks your server for the invoice and opens the pop-up, as above.
import { ExpressButton } from "@intents-fi/react";
<ExpressButton onClick={payWithCrypto} /><ExpressButton variant="line" block>Crypto</ExpressButton> {/* in a three-up row */}<button type="button" id="pay-with-crypto" class="ifpm-Express ifpm-Express--light"><span class="ifpm-Icons" aria-hidden="true"><img src="https://pay.intents.fi/v1/brand/pay-with-crypto-mark-light.svg" width="50" height="20" alt=""></span>Pay with crypto</button>It is ink-filled. Add ifpm-Express--line (React: variant="line") for an outlined button that
matches outlined neighbours. Add ifpm-Express--block (block) to share the row’s width, and use
the shorter label “Crypto” there.
We accept crypto
Section titled “We accept crypto”For a footer, or a row of the ways you take payment:
import { AcceptStrip, TokenStrip } from "@intents-fi/react";
<AcceptStrip /><TokenStrip /> {/* the coins and the count alone */}<span class="ifpm-Accept ifpm-Accept--light"><span class="ifpm-Strip ifpm-Strip--light" role="img" aria-label="USDT, USDC, ETH, SOL, BTC and 1,000 more"><img src="https://pay.intents.fi/v1/brand/token-marks.svg" width="80" height="20" alt=""><span class="ifpm-More" aria-hidden="true">+1,000</span></span><span>We accept crypto</span></span>The strip reads as one image to a screen reader: “USDT, USDC, ETH, SOL, BTC and 1,000 more”.
States
Section titled “States”This preview is the live option.css and markup. Hover a row to see its hover fill.
| State | How you get it | Looks like |
|---|---|---|
| Default | selected={false} / an unchecked radio |
an empty ring, hairline border |
| Hover | the pointer over it | the soft fill, a darker ring |
| Selected | selected / checked |
the soft fill, the radio filled in colorAccent, and the explainer under it |
| Disabled | disabled |
radio, name and coins dimmed, not selectable; the subtitle (your reason) stays readable |
| Dark | theme="dark" / ifpm-Option--dark (auto follows the system) |
the dark checkout ground, light text |
Logo pack
Section titled “Logo pack”The marks, the wordmark, the token strip and the “Pay with crypto” marks, for light and dark backgrounds, are in the logo pack.
Using it in a full checkout: Add crypto to your existing checkout, and the Next.js, Express and PHP examples.