在沙盒环境中体验两种集成模式,无需注册
将客户跳转到我们托管的收银台页面
// 创建收银台会话(后端调用)
const res = await fetch('https://api.ironixpay.com/v1/checkout/sessions', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pricing_amount: '5',
pricing_currency: 'USDT',
currency: 'USDT',
network: 'TRON',
success_url: 'https://yoursite.com/success',
cancel_url: 'https://yoursite.com/cancel'
})
})
const session = await res.json()
// 跳转到收银台
window.location = session.url将支付界面直接嵌入你的页面
import { IronixPay } from '@ironix-pay/sdk'
const ip = new IronixPay({ environment: 'sandbox' })
const el = ip.createPaymentElement({
sessionId: 'cs_...',
theme: 'light',
locale: 'en'
})
el.mount('#checkout')
el.on('payment_success', (result) => {
console.log('Paid!', result.transactionHash)
})5 分钟完成集成,开始收款