solana-dev-payments
Build checkout flows, payment buttons, and QR-based payment requests using Solana Pay conventions, Kit instruction builders, and Kora for gasless flows.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- solana-dev-payments
- license
- MIT
- metadata
- { "author": "Solana Foundation", "source": "https://github.com/solana-foundation/solana-dev-skill", "version": "2.7.0", "category": "Payments" }
- description
- Build checkout flows, payment buttons, and QR-based payment requests using Solana Pay conventions, Kit instruction builders, and Kora for gasless flows.
02 资源文件 2
- 参考文档metadata.json348 B
- 参考文档verification.json1.0 KB
03 SKILL.md 正文
Payments & Commerce
Solana Foundation skill — mirrored in the Musebook skills hub. This entry reproduces, verbatim, the
payments.mdreference of the foundation-maintained solana-dev skill (v2.7.0, MIT) from https://github.com/solana-foundation/solana-dev-skill. It is one of the 16 topic references the solana-dev router discloses progressively; for the full skill (router + all references + nested guides), install the upstream original:npx skills add https://github.com/solana-foundation/solana-dev-skill— also mirrored in this hub as thesolana-deventry. Maintained by the Solana Foundation; Musebook does not author or maintain this content. Relative links in the body point at the upstream skill's file layout and resolve in the full install.
Payments and commerce (optional)
When payments are in scope
Use this guidance when the user asks about:
- checkout flows, tips, payment buttons
- payment request URLs / QR codes
- fee abstraction / gasless transactions
Building payments with Kit (default)
Build payment flows directly on @solana/kit + @solana-program/*:
- SOL transfers:
getTransferSolInstructionfrom@solana-program/system - Token transfers: the
tokenProgram()plugin from@solana-program/token(client.token—transferToATAauto-derives and creates the recipient ATA) - Payment correlation: attach a memo (
@solana-program/memo) or a unique reference account to locate settlement for an order. Neither prevents a second transfer in a separately signed transaction. - Confirmation: track signature status to the commitment level your UX needs (
confirmedfor UI feedback,finalizedfor irreversible fulfillment)
Solana Pay (payment requests / QR)
Use the Solana Pay URL spec for request-based payments (point-of-sale, invoices, QR codes):
solana:<recipient>?amount=..&spl-token=..&reference=..&label=..&message=..- Verify settlement server-side by finding the transaction via the
referencekey and validating recipient, mint, and amount from chain state.
Retry and fulfillment boundaries
- Store the signature before submitting. On timeout, rebroadcast the same signed tx or reconcile it before re-signing; missing RPC history isn't proof of non-payment.
- Make fulfillment idempotent (atomically claim the order in your DB). A reference match alone isn't enough: also require a successful tx at the required commitment.
Kora (gasless / fee abstraction)
Use Kora when users shouldn't need SOL: sponsored fees, fees paid in USDC or another SPL token, or a policy-checked paymaster co-signing user transactions. See kora.md for operator setup and security controls.
UX and security checklist for payments
- Always show recipient + amount + token clearly before signing.
- Keep retries tied to the same authorized payment intent; do not treat a memo or reference as an on-chain duplicate-payment guard.
- Confirm settlement by querying chain state, not by trusting client-side callbacks.
- Handle partial failures gracefully (transaction sent but not confirmed).
- Provide clear error messages for common failure modes (insufficient balance, rejected signature).
- Test settlement logic against Surfpool — set up buyer/merchant token accounts with
surfnet_setTokenAccountand assert post-transaction balances (see testing.md).
References
04 同仓库更多 Skills
youtube-clipper
YouTube 视频智能剪辑工具。下载视频和字幕,AI 分析生成精细章节(几分钟级别), 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频,并生成总结文案。 使用场景:当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词:视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video
viem-integration
Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.
v4-security-foundations
Security-first Uniswap v4 hook development. Use when user mentions "v4 hooks", "hook security", "PoolManager", "beforeSwap", "afterSwap", or asks about V4 hook best practices, vulnerabilities, or audit requirements.
v4-sdk-integration
App-layer SDK guide for building swap and liquidity experiences directly with the Uniswap v4 SDK. Use when user asks about "v4 sdk", "uniswap v4", "v4 swap", "v4 liquidity", "PoolManager", "V4Planner", "StateView", "PositionManager", "pool state", "v4 position", "uniswap sdk", or when building swap/liquidity UX directly with SDKs rather than via the Trading API.
v4-hook-generator
Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.
testing
For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.