Widget SDK
仅需要三步轻松完成集成
1. 引入SDK
<script src="https://pay.blockatm.net/libs/v2/BlockATM.umd.js?apiKey=[API_KEY]"></script><script src="https://cashier-b2b-pre.ufcfan.org/libs/v2/BlockATM.umd.js?apiKey=[API_KEY]"></script>2. 参数签名
// 1. Prepare payment parameters
const options = {
custNo: 'CUST123456', // Customer ID (required)
orderNo: '473_800000001', // Order number
lang: 'en-US', // Language (optional, default: en-US, supports zh-CN/zh-HK/en-US)
chainId: 1, // Blockchain network ID (optional, 1=ETH Mainnet)
currency: 'USDT', // Cryptocurrency type (optional, e.g. USDT)
amount: 100.5, // Payment amount (optional)
};
// 2. Generate signature parameters
const { urlForSignature } = window.BlockATM.generateUrlForSigning({
...options,
apiKey: 'YOUR_API_KEY' // Replace with your API key
});
// 3. Get signature from backend
const { signature } = await fetch("/sign-url", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ urlForSignature }),
}).then(res => res.json());3. 初始化
Last updated