你可以接收什么
Lightning 接收 BTC,不接收稳定币或链上地址转账。每个请求有独立金额、付款哈希和有效期。客户须全额支付 Lightning 账单。
Bitcoin 链上付款设置你的商店
在设置 → 链连接中添加 HTTPS 的 LND 或 WSS 的 NWC,再在店铺启用。当前策略要求端点可公开访问,仅 LAN 或 Tor 地址不能直接连接。
凭据与托管
使用受限收款凭据,绝不使用 LND 管理员或支出 macaroon。NWC 只定义连接,不定义托管方式,请确认钱包由谁保管密钥。
付款会到哪里
二维码包含 BOLT11 Lightning 账单,不是 Bitcoin 地址。不要用链上交易付款。过期后创建新账单,不能简单延长期限。
何时算付款完成?
Wholly Crypto 验证连接钱包报告的结算。未完成账单或暂存 HTLC 不算付款。Lightning 收款没有区块确认或公共交易浏览器链接。
准备好后再转出资金
使用外部钱包或节点管理发送、通道流动性和备份。链上归集不移动 Lightning 余额,项目钱包导出也不备份外部钱包。
Lightning 钱包指南付款问题排查
路由失败时检查入站流动性、钱包可用性和有效期。健康 API 不保证路由成功。付款结果不确定时,先验证结算再请客户重试。
费用和验证
默认处理费为账单法币金额的 1%,从单独的预付余额扣除,实际以分配给你的费率为准。网络费用和服务器成本另计。
公共服务商可能中断或限制请求。提交交易或跳回商店并不能证明已付款,请以验证后的账单状态和签名通知为准。
处理额度 API、IPN 与 Webhook汇率计算器
换算金额
这是估算,不是付款报价。不含网络手续费、交易所费用或商户加价。
汇率来自哪里?
加密货币估算使用缓存的 Kraken 公共价格,并在可用时使用 Binance。部分 Binance 价格以 USDT 作为美元参考。法币汇率来自 Frankfurter,为每日参考汇率,并非实时交易报价。
快照自动刷新。请检查结果下方的来源日期。输入的金额只保留在浏览器中。列出某项资产不保证支持该资产付款。
通过 API 创建账单
在服务器上运行示例,替换 API 主机、项目 ID 和店铺 ID,并保密凭据。金额使用十进制字符串。
先在店铺启用付款方式。筛选只缩小已启用的范围,不添加资产。没有匹配时使用店铺默认方式。展示收银台前请检查返回结果。
: "${WHOLLY_TOKEN:?Set WHOLLY_TOKEN to your server-side API token}"
# Keep this key and the exact body for retries; use a new key for each new invoice.
curl --fail-with-body --max-time 30 \
--request POST \
--url "https://api.example.com/v1/projects/YOUR_PROJECT_ID/stores/YOUR_STORE_ID/invoices" \
--header "Authorization: Bearer $WHOLLY_TOKEN" \
--header 'Idempotency-Key: order-1042-attempt-1' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": "25.00",
"currency": "EUR",
"order_id": "order-1042",
"payment_methods": [
{
"chain_slug": "bitcoin",
"payment_rail": "lightning"
}
]
}'// Node.js 18+ · run on your server, never in browser code.
const token = process.env.WHOLLY_TOKEN;
if (!token) throw new Error("Set WHOLLY_TOKEN");
// Keep this key and the exact body for retries; use a new key for each new invoice.
const body = `{
"amount": "25.00",
"currency": "EUR",
"order_id": "order-1042",
"payment_methods": [
{
"chain_slug": "bitcoin",
"payment_rail": "lightning"
}
]
}`;
const response = await fetch("https://api.example.com/v1/projects/YOUR_PROJECT_ID/stores/YOUR_STORE_ID/invoices", {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Idempotency-Key": "order-1042-attempt-1",
"Content-Type": "application/json"
},
body,
redirect: "error",
signal: AbortSignal.timeout(30000)
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.json());<?php
// PHP 8+ with the cURL extension; run on your server.
$token = getenv('WHOLLY_TOKEN');
if (!$token) { throw new RuntimeException('Set WHOLLY_TOKEN'); }
// Keep this key and the exact body for retries; use a new key for each new invoice.
$body = <<<'JSON'
{
"amount": "25.00",
"currency": "EUR",
"order_id": "order-1042",
"payment_methods": [
{
"chain_slug": "bitcoin",
"payment_rail": "lightning"
}
]
}
JSON;
$ch = curl_init("https://api.example.com/v1/projects/YOUR_PROJECT_ID/stores/YOUR_STORE_ID/invoices");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $token, "Idempotency-Key: order-1042-attempt-1", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => $body,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($response === false) { throw new RuntimeException(curl_error($ch)); }
curl_close($ch);
if ($status < 200 || $status >= 300) { throw new RuntimeException("HTTP $status: $response"); }
print_r(json_decode($response, true, 512, JSON_THROW_ON_ERROR));# Python 3 · standard library; run on your server.
import json
import os
from urllib.request import Request, build_opener, HTTPRedirectHandler
class NoRedirect(HTTPRedirectHandler):
def redirect_request(self, req, fp, code, msg, headers, newurl):
return None
# Keep this key and the exact body for retries; use a new key for each new invoice.
headers = {
"Idempotency-Key": "order-1042-attempt-1",
"Content-Type": "application/json"
}
headers["Authorization"] = "Bearer " + os.environ["WHOLLY_TOKEN"]
body = """{
"amount": "25.00",
"currency": "EUR",
"order_id": "order-1042",
"payment_methods": [
{
"chain_slug": "bitcoin",
"payment_rail": "lightning"
}
]
}""".encode("utf-8")
request = Request("https://api.example.com/v1/projects/YOUR_PROJECT_ID/stores/YOUR_STORE_ID/invoices",
method="POST", headers=headers, data=body)
# Non-2xx responses raise HTTPError. Do not retry writes with a new key.
with build_opener(NoRedirect()).open(request, timeout=30) as response:
print(json.load(response))