question

thinhvu avatar image
thinhvu asked vsdsaaasd answered

Does Clover actually support ZVT?

This question may seem a bit silly because Clover's documentation clearly states that they support ZVT.

But the problem is that we have implemented the ZVT protocol and it works on some other devices, but it doesn't work on Clover.

Even responding to a simple request doesn't work, which makes me wonder if Clover actually supports ZVT.

const net = require('net');

// Clover terminal details
const TERMINAL_IP = '192.168.1.11';
const TERMINAL_PORT = 25690;

// Example ZVT command: Payment request for 10.00 EUR
const paymentCommand = Buffer.from([
    0x06, // STX
    0xD1, // Command: Payment
    0x00, 0x10, // Amount: 10.00 EUR (BCD, big-endian)
    0x03, // ETX
    0xC4  // Checksum (update if needed based on calculation)
]);

// Function to calculate checksum (XOR of all bytes between STX and ETX)
function calculateChecksum(buffer) {
    let checksum = 0;
    for (let i = 1; i < buffer.length - 2; i++) {
        checksum ^= buffer[i];
    }
    return checksum;
}

// Update the checksum in the command
paymentCommand[paymentCommand.length - 1] = calculateChecksum(paymentCommand);

// Create TCP client
const client = new net.Socket();

client.connect(TERMINAL_PORT, TERMINAL_IP, () => {
    console.log(`Connected to Clover terminal at ${TERMINAL_IP}:${TERMINAL_PORT}`);

    // Send the payment command
    client.write(paymentCommand);
    console.log('Payment command sent:', paymentCommand.toString('hex'));
});

// Handle incoming data
client.on('data', (data) => {
    console.log('Response from terminal:', data.toString('hex'));
    client.destroy(); // Close the connection
});

// Handle connection closure
client.on('close', () => {
    console.log('Connection closed.');
});

// Handle errors
client.on('error', (err) => {
    console.error('Error:', err.message);
}
semi-integrations
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
vsdsaaasd avatar image
vsdsaaasd answered

Sí, BetJam tiene un programa de referidos donde puedes ganar bonos adicionales o giros gratis invitando a tus amigos a registrarse en la plataforma https://betjam.site/es/. Cuando tus amigos se registren y realicen su primer depósito, recibirás una recompensa como agradecimiento por la referencia.


10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community