Recently, many friends are working on WeChat mall projects, so I would like to share with you the code for connecting the WeChat Yilian cloud printer interface with a Node.js web development framework based on the Koa.js platform for everyone to learn from.
koahub-yilianyun
WeChat Yilian Cloud Printer Interface
koahub-yilianyun Yilian cloud printer node interface
Installation
$ npm install koahub-yilianyun
Use with co-request
var printer = require('koahub-yilianyun');
var result = yield printer({
"partner": 914,//User ID (obtained from the management center system integration)
"apikey": "3785b31b2c84f3c47e51a6c4481f8a5fc2eea72a",//apikey (obtained from the management center system integration)
"machine_code": "3400453726",//Printer terminal number
"msign": "gn5p5zk585b6",//Printer terminal key
"time": parseInt(new Date().getTime() / 1000), //Current timestamp (server used for verification timeout)
"content": '2222'//Need to transfer the printed content data
});
KoaHub.js -- Node.js web rapid development framework based on Koa.js platform
Code source: http://js.koahub.com