Comparing version 1.59.4 to 1.60.0
@@ -10,2 +10,3 @@ var Util = require("util"); | ||
var request = require("sync-request"); | ||
var encryptor = require("./Crypto/encryptor") | ||
@@ -59,2 +60,13 @@ module.exports = BaseService; | ||
if(this._config.EncryptKeyID && this._config.EncryptKeyName && this._config.EncryptPublicKey){ | ||
encryptPublicKeyInfo = new encryptor.EncryptPublicKeyInfo(); | ||
encryptPublicKeyInfo.setkeyId(this._config.EncryptKeyID) | ||
encryptPublicKeyInfo.setkeyName(this._config.EncryptKeyName) | ||
encryptPublicKeyInfo.setPublicKey(this._config.EncryptPublicKey); | ||
this._encryptPublicKeyInfo = encryptPublicKeyInfo; | ||
this._encryptor = encryptor; | ||
} | ||
linkhub.initialize({ | ||
@@ -61,0 +73,0 @@ LinkID: this._config.LinkID, |
@@ -75,2 +75,37 @@ var Util = require('util'); | ||
BaseService.addMethod(TaxinvoiceService.prototype, 'registTaxCert', function (CorpNum, certPublicKey, certPrivateKey, certCipher, UserID, success, error) { | ||
if(!this._encryptPublicKeyInfo){ | ||
this._throwError(-99999999, 'FLE키 정보가 입력되지 않았습니다.', error); | ||
return; | ||
} | ||
var req = { | ||
certPublicKey: this._encryptor.encryptByte(this._encryptPublicKeyInfo, Buffer.from(certPublicKey, 'base64')), | ||
certPrivateKey: this._encryptor.encryptByte(this._encryptPublicKeyInfo, Buffer.from(certPrivateKey, 'base64')), | ||
certCipher: this._encryptor.encrypt(this._encryptPublicKeyInfo, certCipher), | ||
}; | ||
var postData = this._stringify(req); | ||
this._executeAction({ | ||
uri: '/Taxinvoice/Certificate', | ||
CorpNum: CorpNum, | ||
Method: 'POST', | ||
Data: postData, | ||
UserID: UserID, | ||
success: function (response) { | ||
if (success) success(response); | ||
}, | ||
error: error | ||
}); | ||
}); | ||
BaseService.addMethod(TaxinvoiceService.prototype, 'registTaxCert', function (CorpNum, certPublicKey, certPrivateKey, certCipher, success, error) { | ||
this.registTaxCert(CorpNum, certPublicKey, certPrivateKey, certCipher, '', success, error); | ||
}); | ||
BaseService.addMethod(TaxinvoiceService.prototype, 'getTaxCertInfo', function (CorpNum, UserID, success, error) { | ||
@@ -77,0 +112,0 @@ this._executeAction({ |
{ | ||
"name": "popbill", | ||
"version": "1.59.4", | ||
"version": "1.60.0", | ||
"description": "Popbill API SDK for node. see www.popbill.com", | ||
@@ -5,0 +5,0 @@ "author": "Kim Seongjun <pallet027@gmail.com>", |
# node-popbill | ||
팝빌 node.js SDK v1.59.3 | ||
팝빌 node.js SDK v1.60.0 | ||
@@ -4,0 +4,0 @@ ## Install |
@@ -37,71 +37,71 @@ var popbill = require('./'); | ||
taxinvoiceService.getChargeInfo('1234567890', 'testkorea', | ||
function(response){ | ||
console.log(response); | ||
}, function(result){ | ||
console.log(result); | ||
}); | ||
// taxinvoiceService.getChargeInfo('1234567890', 'testkorea', | ||
// function(response){ | ||
// console.log(response); | ||
// }, function(result){ | ||
// console.log(result); | ||
// }); | ||
// // | ||
// var SubmitID = 'Node-bulk04'; | ||
// var taxinvoiceList = []; | ||
// for (var i =0; i <2; i++){ | ||
// Taxinvoice = { | ||
// writeDate: '20210622', | ||
// chargeDirection: '정과금', | ||
// issueType: '정발행', | ||
// purposeType: '영수', | ||
// issueTiming: '직접발행', | ||
// taxType: '과세', | ||
// | ||
var SubmitID = 'Node-bulk04'; | ||
var taxinvoiceList = []; | ||
for (var i =0; i <2; i++){ | ||
Taxinvoice = { | ||
writeDate: '20210622', | ||
chargeDirection: '정과금', | ||
issueType: '정발행', | ||
purposeType: '영수', | ||
issueTiming: '직접발행', | ||
taxType: '과세', | ||
// //공급자 | ||
// invoicerCorpNum: '1234567890', | ||
// invoicerMgtKey: SubmitID + i, | ||
// invoicerTaxRegID: '' , | ||
// invoicerCorpName: '공급자 상호', | ||
// invoicerCEOName: '대표자 성명', | ||
// invoicerAddr: '공급자 주소', | ||
// invoicerBizClass: '공급자 업종', | ||
// invoicerBizType: '공급자 업태', | ||
// invoicerContactName: '공급자 담당자명', | ||
// invoicerTEL: '070-7510-3710', | ||
// invoicerHP: '010-000-111', | ||
// invoicerEmail: 'test@test.com', | ||
// invoicerSMSSendYN: false, | ||
// | ||
// //공급받는자 | ||
// invoiceeType: '사업자', | ||
// invoiceeCorpNum: '8888888888', | ||
// invoiceeMgtKey: '', | ||
// invoiceeTaxRegID: '', | ||
// invoiceeCorpName: '공급받는자 상호', | ||
// invoiceeCEOName: '공급받는자 대표자 성명', | ||
// invoiceeAddr: '공급받는자 주소', | ||
// invoiceeBizClass: '공급받는자 업종', | ||
// invoiceeBizType: '공급받는자 업태', | ||
// invoiceeContactName1: '공급받는자 담당자명', | ||
// invoiceeTEL1: '010-111-222', | ||
// invoiceeHP1: '070-111-222', | ||
// invoiceeEmail1: 'test@test.com', | ||
// invoiceeSMSSendYN: false, | ||
// taxTotal: '2000', | ||
// supplyCostTotal: '20000', | ||
// totalAmount: '22000', | ||
// //modifyCode | ||
// //originalTaxinvoiceKey | ||
// serialNum: '123', | ||
// cash: '', | ||
// chkBill: '', | ||
// note: '', | ||
// credit: '', | ||
// remark1: '비고1', | ||
// remark2: '', | ||
// remark3: '', | ||
// kwon: '', | ||
// ho: '', | ||
// businessLicenseYN: false, | ||
// bankBookYN: false, | ||
// }; | ||
// taxinvoiceList.push(Taxinvoice); | ||
// }; | ||
//공급자 | ||
invoicerCorpNum: '1234567890', | ||
invoicerMgtKey: SubmitID + i, | ||
invoicerTaxRegID: '' , | ||
invoicerCorpName: '공급자 상호', | ||
invoicerCEOName: '대표자 성명', | ||
invoicerAddr: '공급자 주소', | ||
invoicerBizClass: '공급자 업종', | ||
invoicerBizType: '공급자 업태', | ||
invoicerContactName: '공급자 담당자명', | ||
invoicerTEL: '070-7510-3710', | ||
invoicerHP: '010-000-111', | ||
invoicerEmail: 'test@test.com', | ||
invoicerSMSSendYN: false, | ||
//공급받는자 | ||
invoiceeType: '사업자', | ||
invoiceeCorpNum: '8888888888', | ||
invoiceeMgtKey: '', | ||
invoiceeTaxRegID: '', | ||
invoiceeCorpName: '공급받는자 상호', | ||
invoiceeCEOName: '공급받는자 대표자 성명', | ||
invoiceeAddr: '공급받는자 주소', | ||
invoiceeBizClass: '공급받는자 업종', | ||
invoiceeBizType: '공급받는자 업태', | ||
invoiceeContactName1: '공급받는자 담당자명', | ||
invoiceeTEL1: '010-111-222', | ||
invoiceeHP1: '070-111-222', | ||
invoiceeEmail1: 'test@test.com', | ||
invoiceeSMSSendYN: false, | ||
taxTotal: '2000', | ||
supplyCostTotal: '20000', | ||
totalAmount: '22000', | ||
//modifyCode | ||
//originalTaxinvoiceKey | ||
serialNum: '123', | ||
cash: '', | ||
chkBill: '', | ||
note: '', | ||
credit: '', | ||
remark1: '비고1', | ||
remark2: '', | ||
remark3: '', | ||
kwon: '', | ||
ho: '', | ||
businessLicenseYN: false, | ||
bankBookYN: false, | ||
}; | ||
taxinvoiceList.push(Taxinvoice); | ||
}; | ||
// Taxinvoice = { | ||
@@ -792,11 +792,11 @@ // writeDate: '20210722', | ||
// ); | ||
// | ||
// taxinvoiceService.getUseHistoryURL('1234567890', | ||
// function(response){ | ||
// console.log(response); | ||
// }, function(error){ | ||
// console.log(error); | ||
// } | ||
// ); | ||
taxinvoiceService.getUseHistoryURL('1234567890', | ||
function(response){ | ||
console.log(response); | ||
}, function(error){ | ||
console.log(error); | ||
} | ||
); | ||
// taxinvoiceService.getContactInfo('1234567890', 'testkorea', '', | ||
@@ -869,1 +869,8 @@ // function(contactInfo){ | ||
// }); | ||
taxinvoiceService.registTaxCert('1234567890', publicKey, privateKey, cipher, 'testkorea', | ||
function(response){ | ||
console.log(response); | ||
}, function(error){ | ||
console.log(error); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
451139
35
10719