Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- test eco
- local unicode = require('unicode')
- local event = require("event")
- local computer = require('computer')
- local component = require('component')
- local serialization = require("serialization")
- local tunnel = require('component').tunnel
- local shell = require('shell')
- local request = {
- operation = 'transfer',
- user = 'PandaDoddo',
- key = 'shop',
- target = 'PandaDoddo',
- amount = 100,
- description = 'test',
- answearKey = 'KEY'
- }
- tunnel.send(serialization.serialize(request))
- while true do
- local e = {event.pull('modem_message')}
- local answear = serialization.unserialize(e[6])
- if answear.operation == 'transactionResult' and answear.status == true then
- print('Payment succes!')
- elseif answear.operation == 'transactionResult' and answear.status == false and answear.error == 'timeout' then
- print('Payment timeout!')
- elseif answear.operation == 'transactionResult' and answear.status == false and answear.error == 'deny_command' then
- print('Payment deny')
- end
- if answear.operation == 'transfer' and answear.status == true then
- print('Payment register!')
- elseif answear.operation == 'transfer' and answear.status == false and answear.status == 'Not enough money' then
- print('Not money!')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement