tc-id-verification
Version:
R.O.T. ID Verification with SOAP Client
41 lines (40 loc) • 1.66 kB
JavaScript
;
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var soap = __importStar(require("soap"));
var TCID = /** @class */ (function () {
function TCID() {
this.WSDL_URI = "https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL";
}
TCID.prototype.verif = function (args, callback) {
var _this = this;
args.Ad = args.Ad.toUpperCase();
args.Soyad = args.Soyad.toUpperCase();
if (callback) {
soap.createClient(this.WSDL_URI, function (err, client) {
(err) && callback({ err: err }, undefined);
client.TCKimlikNoDogrula(args, function (err, result) {
(err) ? callback({ err: err }, undefined) : callback(undefined, { verify: result.TCKimlikNoDogrulaResult, ops: args });
});
});
}
else {
return new Promise(function (res, rej) {
soap.createClient(_this.WSDL_URI, function (err, client) {
(err) && rej(err);
client.TCKimlikNoDogrula(args, function (err, result) {
(err) ? rej(err) : res({ verify: result.TCKimlikNoDogrulaResult, ops: args });
});
});
});
}
};
return TCID;
}());
exports.TCID = TCID;