Checkout Terminal
Flow
import { RevibaseProvider, transferTokens } from "@revibase/lite";
const provider = new RevibaseProvider();
async function runCheckoutTerminalFlow() {
const orderTotal = 1_000_000n;
const merchantWallet = "MERCHANT_WALLET_ADDRESS";
// 1) Create channel
const { channelId, url } = await provider.createChannel();
// 2) Open `url` on the checkout device (QR code or deep link)
const { txSig, user } = await transferTokens(
provider,
{
amount: orderTotal,
destination: merchantWallet,
},
{ channelId },
);
// 3) Close channel when done
await provider.closeChannel(channelId);
return { txSig, url };
}Last updated