สิ่งที่รับได้
Lightning รับ BTC ไม่ใช่สเตเบิลคอยน์หรือการโอนไปที่อยู่บนเชน แต่ละคำขอชำระมียอด payment hash และวันหมดอายุของตัวเอง ลูกค้าต้องจ่ายใบแจ้งหนี้ Lightning เต็มจำนวน
การชำระ Bitcoin บนเชนตั้งค่าร้านของคุณ
ในตั้งค่า → การเชื่อมต่อเชน เพิ่ม LND ผ่าน HTTPS หรือ Nostr Wallet Connect ผ่าน WSS แล้วเปิดการเชื่อมต่อนั้นในร้าน นโยบายปัจจุบันต้องใช้ endpoint ที่เข้าถึงได้จากสาธารณะ ที่อยู่เฉพาะ LAN หรือ Tor จึงใช้โดยตรงไม่ได้
ข้อมูลรับรองและผู้ถือครองเงิน
ใช้ข้อมูลรับรองที่จำกัดเฉพาะการรับเงิน อย่าใช้ macaroon สำหรับผู้ดูแลหรือใช้จ่ายของ LND NWC บอกวิธีเชื่อมต่อ ไม่ได้บอกว่าใครถือเงิน ตรวจว่ากระเป๋าที่เลือกถือคีย์แทนคุณหรือไม่
เงินที่รับจะไปที่ใด
QR มีใบแจ้งหนี้ Lightning แบบ BOLT11 ไม่ใช่ที่อยู่ Bitcoin อย่าส่งธุรกรรมบนเชนเพื่อจ่าย หากคำขอหมดอายุให้สร้างใบแจ้งหนี้ใหม่ ไม่สามารถยืดเวลาคำขอเดิมได้เฉย ๆ
เมื่อไรถือว่าชำระเสร็จ?
Wholly Crypto ตรวจผลชำระเสร็จที่กระเป๋าที่เชื่อมต่อรายงาน ใบแจ้งหนี้ที่ยังเปิดหรือ HTLC ที่ยังค้างไม่ใช่การชำระแล้ว เงินรับ Lightning ไม่มีการยืนยันบล็อกหรือลิงก์ธุรกรรมใน block explorer สาธารณะ
ย้ายเงินเมื่อคุณพร้อม
ใช้กระเป๋าหรือโหนดภายนอกสำหรับส่งเงิน จัดการสภาพคล่องช่องทาง และ backup การ sweep บนเชนของ Wholly Crypto ย้ายยอด Lightning ไม่ได้ การ export กระเป๋าโปรเจกต์ไม่ได้สำรองกระเป๋าภายนอกนั้น
คู่มือกระเป๋า Lightningแก้ปัญหาการชำระเงิน
หากหาเส้นทางชำระไม่ได้ ให้ตรวจสภาพคล่องขาเข้า ความพร้อมของกระเป๋า และวันหมดอายุคำขอ API ที่ปกติไม่ได้รับประกันว่าจะหาเส้นทางได้ หากผลการจ่ายไม่แน่นอน ให้ตรวจว่าชำระเสร็จหรือยังก่อนขอให้ลูกค้าลองใหม่
ค่าธรรมเนียมและการตรวจสอบ
ค่าธรรมเนียมประมวลผลเริ่มต้นคือ 1% ของมูลค่าใบแจ้งหนี้ในเงินตราทั่วไป จ่ายจากเครดิตแยก ใช้อัตราที่กำหนดให้คุณ ค่าธรรมเนียมเครือข่ายและค่าเซิร์ฟเวอร์แยกต่างหาก
ผู้ให้บริการสาธารณะอาจหยุดทำงานหรือจำกัดอัตรา ธุรกรรมที่ส่งแล้วหรือการเปลี่ยนเส้นทางกลับไม่ใช่หลักฐานชำระ ใช้สถานะใบแจ้งหนี้ที่ตรวจสอบแล้วและการแจ้งเตือนที่ลงนาม
เครดิตประมวลผล API, IPN และ webhookเครื่องคำนวณอัตราแลกเปลี่ยน
แปลงจำนวนเงิน
เป็นค่าประมาณ ไม่ใช่ราคาเสนอชำระเงิน ไม่รวมค่าธรรมเนียมเครือข่าย ค่าธรรมเนียมศูนย์ซื้อขาย และส่วนต่างผู้ค้า
อัตรามาจากไหน?
ค่าประมาณคริปโตใช้ราคาสาธารณะ Kraken ในแคช และ Binance เมื่อมี บางราคา Binance ใช้ USDT อ้างอิง USD อัตราเงินตราทั่วไปมาจาก Frankfurter เป็นอัตราอ้างอิงรายวัน ไม่ใช่ราคาเสนอซื้อขายสด
สแนปช็อตรีเฟรชอัตโนมัติ ตรวจวันที่แหล่งข้อมูลใต้ผลลัพธ์ จำนวนที่กรอกอยู่ในเบราว์เซอร์ของคุณ การมีชื่อสินทรัพย์ไม่รับประกันว่ารองรับการชำระเงิน
Kraken · Binance · Frankfurter · ชื่อและไอคอนสินทรัพย์: CoinGecko
สร้างใบแจ้งหนี้ด้วย API
รันตัวอย่างเหล่านี้บนเซิร์ฟเวอร์คุณ แทนที่โฮสต์ API รหัสโปรเจกต์ และรหัสร้าน และเก็บข้อมูลรับรองเป็นส่วนตัว ยอดใช้สตริงทศนิยม
เปิดวิธีชำระในร้านก่อน การเลือกจำกัดวิธีที่เปิดใช้อยู่ ไม่ได้เพิ่มสินทรัพย์ หากไม่ตรงกับรายการใดจะใช้ค่าเริ่มต้นร้าน ตรวจวิธีชำระในคำตอบก่อนแสดงหน้าชำระเงิน
: "${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))