pcpos-parsian
v1.1.2
Published
work with parsian pos
Downloads
23
Maintainers
Readme
manatop-pcpos-parsian
Manatop is a Nodejs library for parsian pos (pec)
this package need pos device to work.
Pos Models
Model | suitable ------------- | ------------- IC3600 Bitel | yes IC3300 Bitel | yes
Installation
Use the package manager manatop to install pcpos-parsian.
$ npm i pcpos-parsian
npm i pcpos-parsian
Usage
const manatopSDK = require('pcpos-parsian');
Definition listener pos response result event
manatopSDK.posDevice.on('posResponseResult', function (result) {
console.log(JSON.stringify(result));
});
Definition listener error configuration event
manatopSDK.posDevice.on('errorConfiguration', function (result) {
console.log(JSON.stringify(result));
});
Config Pos Connection
var posconfig = {
IP: "192.168.50.50",
Port: 2000
};
manatopSDK.setPosConfig(posconfig);
Get Last Successed Transaction
manatopSDK.getLastTransaction();
Create purchaseModel
var purchaseModel = {
Amount: "1000",
SignCode:"",
HolderReceiptMessage: "متن دلخواه برای پذیرنده",
MerchantReceiptMessage: "متن دلخواه برای مشتری"
};
// Common purchase
manatopSDK.purchase(purchaseModel);
Create purchaseWareHoffModel
var purchaseWareHoffModel = {
Amount: "1000",
DepositId: "000000000000000000000000000000",
SignCode:"",
HolderReceiptMessage: "متن دلخواه برای پذیرنده",
MerchantReceiptMessage: "متن دلخواه برای مشتری"
};
// PurchaseWareHoff
manatopSDK.purchaseWareHoff(purchaseWareHoffModel);