











Mã tham chiếu tự động (VS) cho nhiều khoản thanh toán 
Ký hiệu biến — mã tham chiếu để theo dõi thanh toán. Để theo dõi, chúng tôi thêm 4 chữ số vào cuối số tiền; ví dụ USDT trên mạng Tron có 6 chữ số thập phân. Dùng hai số đầu, ví dụ 10.55 (10 đô 55 xu), còn với ký hiệu biến sẽ là 10.550001. Thực tế nhỏ hơn 1000 lần một xu — người mua không trả thừa. Nhưng bạn có thể theo dõi khoản thanh toán.
Khi ở chế độ Merchant dùng hết đến 10 000 mã, sẽ tự thêm địa chỉ USDT mới cho 10 000 mã tiếp theo — và cứ thế mãi. Như vậy có thể phục vụ cả cửa hàng lớn với hàng nghìn đơn mỗi ngày.
Nếu không, bạn phải dùng địa chỉ riêng cho mỗi khoản thanh toán. Rồi trả phí mạng để gom tiền về một địa chỉ. Ví dụ, nếu bạn có 100 khoản thanh toán trên 100 địa chỉ, để gom tiền về một địa chỉ (để đổi, v.v.) sẽ phải trả phí 100 lần (0.9$ mỗi lần). Chúng tôi đã giải quyết bằng mã tham chiếu như mô tả ở trên.
app.post('/mi_webhook_subscription/', bodyParser.json(), (request, response) => {
try {
let eventObj = request.body;
const signature = request.headers['mitilena-signature'];
if (signature === endpointSecretMitilenaNewOur) {
if (!eventObj.statusObj) {
return response.status(400).send('Error, no object.');
}
let hookObj = eventObj.statusObj;
...Your private secret key:
You should only process requests to your webhook that contain this key.
statusObj = {
mitilenaInvoiceId: 'auto-683dc5-03f2c0-e3f06a-example-string', // never undefined
yourPaymentId: 'stringOrNull', // never undefined
yourProductName: 'stringOrNull', // never undefined
yourProductId: 'stringOrNull', // never undefined
secretKey: 'your-unique-secret-key', // never undefined,
stableCoinAmount: 0, // number, never undefined
stableCoinSymbol: 'USDT', // never undefined
stableCoinBlockchain: 'tether-trc20', // never undefined
stableCoinContractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', // string | null
localCurrencyAmount: 0, // number, never undefined
localCurrencyCode: 'EUR', /// ISO 4217 currency code, never undefined
wasPaid: true, // true | false, never undefined
}
/* payment time === webhook call time.
We try to send a request immediately after the payment is detected
!!!
If the secret key is incorrect or at least one field is
undefined - this is a fake request, do not set the order
as paid in your system! */