Comparing version 1.8.1 to 1.9.0
@@ -14,3 +14,3 @@ var popbill = require('./'); | ||
faxService.getURL('1234567890','BOX', | ||
faxService.getURL('1234567890','BOX', 'testkorea', | ||
function(URL){ | ||
@@ -65,2 +65,10 @@ console.log(URL); | ||
faxService.sendFax('1234567890','07043042991','070111222', '수신자명', FilePaths, '', '발신자명', true, 'RequestNum Test', '20180903150553', | ||
function(receiptNum){ | ||
console.log('receiptNum is : ' + receiptNum); | ||
}, function(error){ | ||
console.log(error); | ||
}); | ||
faxService.sendFax('1234567890','07043042991','070111222', '수신자명', FilePaths, '', '발신자명', true, '팩스전송제목', | ||
@@ -92,4 +100,10 @@ function(receiptNum){ | ||
receiptNum = "017071815093700001" | ||
receiptNum = "018090315112300001"; | ||
faxService.resendFax('1234567890', receiptNum, '', '발신자명', '', '', '', '팩스재전송 제목(RequestNum)', '20180903153642', | ||
function(receiptNum){ | ||
console.log('receiptNum is : ' + receiptNum); | ||
}, function(error){ | ||
console.log(error); | ||
}); | ||
faxService.resendFax('1234567890', receiptNum, '', '발신자명', '', '', '', '팩스재전송 제목', | ||
@@ -109,2 +123,26 @@ function(receiptNum){ | ||
OrgRequestNum = "20180903154412"; | ||
faxService.resendFaxRN('1234567890', OrgRequestNum, '07043042992', '김현진', '010111222', '수신자', '20180904153946', 'resendFaxRN title', '20180903154009', | ||
function(receiptNum){ | ||
console.log('receiptNum is : ' + receiptNum); | ||
}, function(error){ | ||
console.log(error); | ||
}); | ||
faxService.resendFaxRN('1234567890', OrgRequestNum, '', '', '', '', '', '', '20180903154455', | ||
function(receiptNum){ | ||
console.log('receiptNum is : ' + receiptNum); | ||
}, function(error){ | ||
console.log(error); | ||
}); | ||
faxService.resendFaxRN('1234567890', OrgRequestNum, '20180903154412', 'title test', | ||
function(receiptNum){ | ||
console.log('receiptNum is : ' + receiptNum); | ||
}, function(error){ | ||
console.log(error); | ||
}); | ||
faxService.getFaxResult('1234567890', '015081013080700001', | ||
@@ -124,2 +162,17 @@ function(response){ | ||
faxService.getFaxResultRN('1234567890', '20180903150553', | ||
function(response){ | ||
console.log(response); | ||
},function(error){ | ||
console.log(error); | ||
}); | ||
faxService.cancelReserveRN('1234567890', '20180903154009', 'testkorea', | ||
function(response){ | ||
console.log(response); | ||
}, function(error){ | ||
console.log(error); | ||
}) | ||
faxService.getSenderNumberList('1234567890', | ||
@@ -126,0 +179,0 @@ function(response){ |
@@ -71,3 +71,3 @@ var popbill = require('./'); | ||
]; | ||
// | ||
var kakaoReceiver_multi = [ | ||
@@ -97,3 +97,4 @@ { | ||
kakaoService.sendATS_one('1234567890', '018020000002', '070-4304-2993', '테스트 템플릿 입니다.', "알림톡 대체 문자", "A", "", "010111222", "partner", 'unusualID', | ||
ATS | ||
kakaoService.sendATS_one('1234567890', '018080000079', '070-4304-2992', '테스트 템플릿 입니다.', "알림톡 대체 문자", "A", "", "010111222", "partner", 'testkorea', "20180903144355", | ||
function (receiptNum) { | ||
@@ -105,3 +106,3 @@ console.log("receiptNum is :" + receiptNum); | ||
kakaoService.sendATS_same('1234567890', '018020000002', '070-4304-2993', '테스트 템플릿 입니다.', "알림톡 대체 문자", "", "", kakaoReceiver_same, 'asd', | ||
kakaoService.sendATS_same('1234567890', '018080000079', '070-4304-2992', '테스트 템플릿 입니다.', "알림톡 대체 문자", "", "", kakaoReceiver_same, 'testkorea', '20180903144524', | ||
function (receiptNum) { | ||
@@ -113,3 +114,3 @@ console.log("receiptNum is :" + receiptNum); | ||
kakaoService.sendATS_multi('1234567890', '018020000002', '070-4304-2993', "C", "", kakaoReceiver_multi, "testkorea", | ||
kakaoService.sendATS_multi('1234567890', '018080000079', '070-4304-2992', "C", "", kakaoReceiver_multi, "testkorea", '20180903144525', | ||
function (receiptNum) { | ||
@@ -121,3 +122,5 @@ console.log("receiptNum is :" + receiptNum); | ||
kakaoService.sendFTS_one('1234567890', '@팝빌', '07043042993', '친구톡 입니다', '대체문자 입니다', 'A', '', '010111222', 'partner', '', btns, | ||
kakaoService.sendFTS_one('1234567890', '@팝빌', '07043042992', '친구톡 입니다', '대체문자 입니다', 'A', '', '010111222', 'partner', '', btns, 'testkorea', '20180903144520', | ||
function (receiptNum) { | ||
@@ -129,3 +132,3 @@ console.log("receiptNum is :" + receiptNum); | ||
kakaoService.sendFTS_same('1234567890', '@팝빌', '07043042993', '친구톡 동보 입니다', '대체문자 입니다.', 'A' , '', '', kakaoReceiver_same, btns, | ||
kakaoService.sendFTS_same('1234567890', '@팝빌', '07043042992', '친구톡 동보 입니다', '대체문자 입니다.', 'A' , '', '', kakaoReceiver_same, btns, 'testkorea', '20180903144521', | ||
function (receiptNum) { | ||
@@ -137,3 +140,3 @@ console.log("receiptNum is :" + receiptNum); | ||
kakaoService.sendFTS_multi('1234567890', '@팝빌', '07043042993', 'A' , '', '', kakaoReceiver_multi, btns, 'testkorea', | ||
kakaoService.sendFTS_multi('1234567890', '@팝빌', '07043042992', 'A' , '', '', kakaoReceiver_multi, btns, 'testkorea', '20180903144522', | ||
function (receiptNum) { | ||
@@ -147,3 +150,3 @@ console.log("receiptNum is :" + receiptNum); | ||
kakaoService.sendFMS_one('1234567890', '@팝빌', '07043042993', '친구톡 이미지 입니다', '대체문자 입니다', 'A', "", "010111222", "popbill", "", "http://linkhub.co.kr", FilePath, btns, | ||
kakaoService.sendFMS_one('1234567890', '@팝빌', '07043042992', '친구톡 이미지 입니다', '대체문자 입니다', 'A', "", "010111222", "popbill", "", "http://linkhub.co.kr", FilePath, btns, 'testkorea', '20180903', | ||
function (receiptNum) { | ||
@@ -155,3 +158,3 @@ console.log("receiptNum is :" + receiptNum); | ||
kakaoService.sendFMS_same('1234567890', '@팝빌', '07043042993', '친구톡 이미지 동보 입니다', '대체문자 입니다', 'A', "", "", "http://linkhub.co.kr", FilePath, kakaoReceiver_same, btns, 'testkorea', | ||
kakaoService.sendFMS_same('1234567890', '@팝빌', '07043042992', '친구톡 이미지 동보 입니다', '대체문자 입니다', 'A', "", "", "http://linkhub.co.kr", FilePath, kakaoReceiver_same, btns, 'testkorea','20180903145106', | ||
function (receiptNum) { | ||
@@ -163,3 +166,3 @@ console.log("receiptNum is :" + receiptNum); | ||
kakaoService.sendFMS_multi('1234567890', '@팝빌', '07043042993', 'A', "20180409001200", "", "http://linkhub.co.kr", FilePath, kakaoReceiver_multi, btns, 'testkorea', | ||
kakaoService.sendFMS_multi('1234567890', '@팝빌', '07043042992', 'A', "20180409001200", "", "http://linkhub.co.kr", FilePath, kakaoReceiver_multi, btns, 'testkorea','20180903145107', | ||
function (receiptNum) { | ||
@@ -184,4 +187,16 @@ console.log("receiptNum is :" + receiptNum); | ||
}); | ||
kakaoService.getMessagesRN('1234567890', '20180903144355', | ||
function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
kakaoService.getMessagesRN('1234567890', '20180903144355', 'testkorea', | ||
function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
kakaoService.cancelReserve('1234567890', '018040311145500001', | ||
kakaoService.cancelReserve('1234567890', '018090314525300001', | ||
function (response) { | ||
@@ -193,3 +208,3 @@ console.log(response); | ||
kakaoService.cancelReserve('1234567890', '018040410511300001', 'testkorea', | ||
kakaoService.cancelReserve('1234567890', '018090314525300001', 'testkorea', | ||
function (response) { | ||
@@ -202,2 +217,16 @@ console.log(response); | ||
kakaoService.cancelReserveRN('1234567890', '20180903145106', | ||
function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
kakaoService.cancelReserveRN('1234567890', '20180903145106', 'testkorea', | ||
function (response) { | ||
console.log(response); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
State = [0, 1, 2, 3, 4, 5]; | ||
@@ -204,0 +233,0 @@ Item = ['ATS', 'FTS', 'FMS']; |
@@ -8,2 +8,3 @@ var Util = require('util'); | ||
var zlib = require('zlib'); | ||
var request = require('sync-request'); | ||
@@ -44,19 +45,18 @@ module.exports = BaseService; | ||
var expired = true; | ||
var UTCTime = getTime(); | ||
if (typeof newToken === 'function') { | ||
var expiration = new Date(newToken(function () { | ||
}, err).expiration); | ||
if (expiration) { | ||
linkhub.getTime( | ||
success = function (UTCTime) { | ||
expired = UTCTime > expiration; | ||
} | ||
); | ||
} else { | ||
expired = false; | ||
} | ||
var expiration = new Date(newToken(function () { | ||
}, err).expiration); | ||
if (expiration) { | ||
expired = Date.parse(UTCTime) > Date.parse(expiration); | ||
} else { | ||
expired = true; | ||
} | ||
} | ||
if (expired) { | ||
newToken = linkhub.newToken(this.ServiceID, CorpNum, this._getScopes(), null); | ||
newToken = linkhub.newToken(this.ServiceID, CorpNum, this._getScopes(), null, UTCTime, false); | ||
this._Linkhub_Token_Cash[CorpNum] = newToken; | ||
@@ -235,3 +235,3 @@ } | ||
Token(function (token) { | ||
console.log(token.session_token); | ||
if (token) headers['Authorization'] = 'Bearer ' + token.session_token; | ||
@@ -374,1 +374,10 @@ if (options.UserID) headers['x-pb-userid'] = options.UserID; | ||
}; | ||
function getTime(url){ | ||
var response = request( | ||
'GET', | ||
'https://auth.linkhub.co.kr/Time' | ||
); | ||
return response.body.toString('utf8'); | ||
} |
@@ -40,2 +40,17 @@ var Util = require('util'); | ||
BaseService.addMethod(FaxService.prototype, "sendFax", function(CorpNum, Sender, Receiver, ReceiverName, FilePaths, ReserveDT, SenderName, AdsYN, Title, RequestNum, success, error){ | ||
var options = { | ||
SenderNum : Sender, | ||
SenderName : SenderName, | ||
Receiver : Receiver, | ||
ReceiverName : ReceiverName, | ||
FilePaths : FilePaths, | ||
ReserveDT : ReserveDT, | ||
AdsYN : AdsYN, | ||
Title : Title, | ||
RequestNum: RequestNum, | ||
} | ||
this.sendFax(CorpNum, options, success, error); | ||
}); | ||
BaseService.addMethod(FaxService.prototype, "sendFax", function(CorpNum, Sender, Receiver, ReceiverName, FilePaths, ReserveDT, SenderName, AdsYN, Title, success, error){ | ||
@@ -119,2 +134,3 @@ var options = { | ||
adsYN : options.AdsYN, | ||
requestNum: options.RequestNum, | ||
rcvs : [] | ||
@@ -157,2 +173,16 @@ }; | ||
BaseService.addMethod(FaxService.prototype, "resendFax", function(CorpNum, ReceiptNum, Sender, SenderName, Receiver, ReceiverName, ReserveDT, Title, RequestNum, success, error){ | ||
var options = { | ||
ReceiptNum : ReceiptNum, | ||
SenderNum : Sender, | ||
SenderName : SenderName, | ||
Receiver : Receiver, | ||
ReceiverName : ReceiverName, | ||
ReserveDT : ReserveDT, | ||
Title : Title, | ||
RequestNum: RequestNum, | ||
} | ||
this.resendFax(CorpNum, options, success, error); | ||
}); | ||
BaseService.addMethod(FaxService.prototype, "resendFax", function(CorpNum, ReceiptNum, Sender, SenderName, Receiver, ReceiverName, ReserveDT, Title, success, error){ | ||
@@ -208,2 +238,3 @@ var options = { | ||
if(options.Title != "") req['title'] = options.Title; | ||
if(options.RequestNum != "") req['requestNum'] = options.RequestNum; | ||
@@ -239,2 +270,98 @@ if ( options.Receiver != null ) { | ||
BaseService.addMethod(FaxService.prototype, "resendFaxRN", function(CorpNum, OrgRequestNum, RequestNum, Title, success, error){ | ||
var options = { | ||
RequestNum: RequestNum, | ||
Title : Title, | ||
OrgRequestNum : OrgRequestNum, | ||
} | ||
this.resendFaxRN(CorpNum, options, success, error); | ||
}); | ||
BaseService.addMethod(FaxService.prototype, "resendFaxRN", function(CorpNum, OrgRequestNum, Sender, SenderName, ReserveDT, Title, RequestNum, success, error){ | ||
var options = { | ||
SenderNum : Sender, | ||
SenderName : SenderName, | ||
ReserveDT : ReserveDT, | ||
Title : Title, | ||
RequestNum: RequestNum, | ||
OrgRequestNum : OrgRequestNum, | ||
} | ||
this.resendFaxRN(CorpNum, options, success, error); | ||
}); | ||
BaseService.addMethod(FaxService.prototype, "resendFaxRN", function(CorpNum, OrgRequestNum, Receiver, ReceiverName, ReserveDT, Title, RequestNum, success, error){ | ||
var options = { | ||
Receiver : Receiver, | ||
ReceiverName : ReceiverName, | ||
ReserveDT : ReserveDT, | ||
Title : Title, | ||
RequestNum: RequestNum, | ||
OrgRequestNum : OrgRequestNum, | ||
} | ||
this.resendFaxRN(CorpNum, options, success, error); | ||
}); | ||
BaseService.addMethod(FaxService.prototype, "resendFaxRN", function(CorpNum, OrgRequestNum, Sender, SenderName, Receiver, ReceiverName, ReserveDT, Title, RequestNum, success, error){ | ||
var options = { | ||
SenderNum : Sender, | ||
SenderName : SenderName, | ||
Receiver : Receiver, | ||
ReceiverName : ReceiverName, | ||
ReserveDT : ReserveDT, | ||
Title : Title, | ||
RequestNum: RequestNum, | ||
OrgRequestNum : OrgRequestNum, | ||
} | ||
this.resendFaxRN(CorpNum, options, success, error); | ||
}); | ||
BaseService.addMethod(FaxService.prototype, "resendFaxRN", function(CorpNum, options, success, error) { | ||
if(!options.OrgRequestNum) { | ||
this._throwError(-99999999,"원본 팩스 요청번호가 입력되지 않았습니다.",error); | ||
return; | ||
} | ||
var req = { | ||
rcvs : [] | ||
}; | ||
if(options.SenderNum != "") req['snd'] = options.SenderNum; | ||
if(options.SenderName != "") req['sndnm'] = options.SenderName; | ||
if(options.sndDT != "") req['sndDT'] = options.ReserveDT; | ||
if(options.Title != "") req['title'] = options.Title; | ||
if(options.RequestNum != "") req['requestNum'] = options.RequestNum; | ||
if ( options.Receiver != null ) { | ||
if ( typeof options.Receiver === 'string' ) { | ||
if (options.Receiver != "" && options.ReceiverName != ""){ | ||
req.rcvs.push({rcv : options.Receiver,rcvnm : options.ReceiverName,}); | ||
} | ||
} else if(Array.isArray(options.Receiver)) { | ||
for(var i in options.Receiver) { | ||
req.rcvs.push({rcv : options.Receiver[i].receiveNum , rcvnm : options.Receiver[i].receiveName}); | ||
} | ||
} else { | ||
req.rcvs.push({rcv : options.Receiver.receiveName , rcvnm : options.Receiver.receiveNum}); | ||
} | ||
} | ||
var postData = this._stringify(req); | ||
this._executeAction({ | ||
uri : '/FAX/Resend/'+options.OrgRequestNum, | ||
Method : 'POST', | ||
CorpNum : CorpNum, | ||
UserID : options.UserID, | ||
Data : postData, | ||
success : function(response){ | ||
if(success) success(response.receiptNum); | ||
}, | ||
error : error | ||
}); | ||
}); | ||
FaxService.prototype.getFaxResult = function(CorpNum, ReceiptNum, success, error){ | ||
@@ -257,2 +384,20 @@ if(!ReceiptNum || 0 === ReceiptNum.length) { | ||
FaxService.prototype.getFaxResultRN = function(CorpNum, RequestNum, success, error){ | ||
if(!RequestNum || 0 === RequestNum.length) { | ||
this._throwError(-99999999,'전송요청번호가 입력되지 않았습니다.',error); | ||
return; | ||
} | ||
this._executeAction({ | ||
uri : '/FAX/Get/' + RequestNum, | ||
CorpNum : CorpNum, | ||
Method : 'GET', | ||
success : function(response){ | ||
if(success) success(response); | ||
}, | ||
error : error | ||
}); | ||
}; | ||
BaseService.addMethod(FaxService.prototype, "getURL", function(CorpNum, TOGO, success, error){ | ||
@@ -292,2 +437,19 @@ this.getURL(CorpNum, TOGO, '', success,error); | ||
FaxService.prototype.cancelReserveRN = function(CorpNum, RequestNum, success, error){ | ||
if(!RequestNum || 0 === RequestNum.length) { | ||
this._throwError(-99999999,'전송요청번호가 입력되지 않았습니다.',error); | ||
return; | ||
} | ||
this._executeAction({ | ||
uri : '/FAX/Cancel/' + RequestNum, | ||
CorpNum : CorpNum, | ||
Method : 'GET', | ||
success : function(response){ | ||
if(success) success(response); | ||
}, | ||
error : error | ||
}); | ||
}; | ||
FaxService.prototype.search = function(CorpNum, SDate, EDate, State, ReserveYN, SenderOnly, Order, Page, PerPage, success, error){ | ||
@@ -294,0 +456,0 @@ if(!SDate || 0 === SDate.length) { |
@@ -87,3 +87,3 @@ var Util = require('util'); | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_one', function (CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, receiver, receiverName, success, error) { | ||
this.sendATS_one(CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, receiver, receiverName, "", success, error); | ||
this.sendATS_one(CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, receiver, receiverName, "", "", success, error); | ||
}); | ||
@@ -99,11 +99,29 @@ //SendATS one (UserID) | ||
this.sendATS_same(CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, msg, UserID, success, error); | ||
this.sendATS_same(CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, msg, UserID, "", success, error); | ||
}); | ||
//SendATS one (RequestNum) | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_one', function (CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, receiver, receiverName, UserID, requestNum, success, error) { | ||
var msg = { | ||
rcv: receiver, | ||
rcvnm: receiverName, | ||
msg: content, | ||
altmsg: altContnet | ||
}; | ||
this.sendATS_same(CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, msg, UserID, requestNum, success, error); | ||
}); | ||
//SendATS multi | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_multi', function (CorpNum, templateCode, snd, altSendType, sndDT, msgs, success, errpr) { | ||
this.sendATS_multi(CorpNum, templateCode, snd, altSendType, sndDT, msgs, '', success, errpr) | ||
this.sendATS_multi(CorpNum, templateCode, snd, altSendType, sndDT, msgs, "", "", success, errpr) | ||
}); | ||
//SendATS multi (UserID) | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_multi', function (CorpNum, templateCode, snd, altSendType, sndDT, msgs, UserID, success, error) { | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_multi', function (CorpNum, templateCode, snd, altSendType, sndDT, msgs, UserID, success, errpr) { | ||
this.sendATS_multi(CorpNum, templateCode, snd, altSendType, sndDT, msgs, UserID, "", success, errpr) | ||
}); | ||
//SendATS multi (requestNum) | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_multi', function (CorpNum, templateCode, snd, altSendType, sndDT, msgs, UserID, requestNum, success, error) { | ||
var msg = []; | ||
@@ -129,3 +147,3 @@ | ||
this.sendATS_same(CorpNum, templateCode, snd, '', '', altSendType, sndDT, msg, UserID, success, error); | ||
this.sendATS_same(CorpNum, templateCode, snd, '', '', altSendType, sndDT, msg, UserID, requestNum, success, error); | ||
}); | ||
@@ -135,6 +153,12 @@ | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_same', function (CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, msgs, success, error) { | ||
this.sendATS_same(CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, msgs, '', success, error) | ||
this.sendATS_same(CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, msgs, "", "", success, error) | ||
}); | ||
//SendATS smae (UserID) | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_same', function (CorpNum, templateCode, snd, content, altContent, altSendType, sndDT, msgs, UserID, success, error) { | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_same', function (CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, msgs, UserID, success, error) { | ||
this.sendATS_same(CorpNum, templateCode, snd, content, altContnet, altSendType, sndDT, msgs, UserID, "", success, error) | ||
}); | ||
//SendATS smae (requestNum) | ||
BaseService.addMethod(KakaoService.prototype, 'sendATS_same', function (CorpNum, templateCode, snd, content, altContent, altSendType, sndDT, msgs, UserID, requestNum, success, error) { | ||
if (!CorpNum || 0 === CorpNum.length) { | ||
@@ -151,2 +175,3 @@ this._throwError(-99999999, '팝빌회원 사업자번호가 입력되지 않았습니다.', error); | ||
sndDT: sndDT, | ||
requestNum: requestNum, | ||
msgs: [] | ||
@@ -188,8 +213,15 @@ }; | ||
//SendFTS one | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_one', function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, btns, success, error) { | ||
this.sendFTS_one(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, btns, "", success, error); | ||
this.sendFTS_one(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, btns, "", "", success, error); | ||
}); | ||
//SendFTS one (UserID) | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_one', function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, btns, UserID, success, error) { | ||
this.sendFTS_one(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, btns, UserID, "", success, error); | ||
}); | ||
//SendFTS one (requestNum) | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_one', function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, btns, UserID, requestNum, success, error) { | ||
var msg = { | ||
@@ -202,11 +234,19 @@ rcv: receiver, | ||
this.sendFTS_same(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msg, btns, success, error); | ||
this.sendFTS_same(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msg, btns, UserID, requestNum, success, error); | ||
}); | ||
//SendFTS multi | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_multi', function (CropNum, plusFriendID, snd, altSendType, sndDT, adsYN, msgs, btns, success, error) { | ||
this.sendFTS_multi(CropNum, plusFriendID, snd, altSendType, sndDT, adsYN, msgs, btns, "", success, error); | ||
this.sendFTS_multi(CropNum, plusFriendID, snd, altSendType, sndDT, adsYN, msgs, btns, "", "", success, error); | ||
}); | ||
//SendFTS multi (UserID) | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_multi', function (CorpNum, plusFriendID, snd, altSendType, sndDT, adsYN, msgs, btns, UserID, success, error) { | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_multi', function (CropNum, plusFriendID, snd, altSendType, sndDT, adsYN, msgs, btns, UserID, success, error) { | ||
this.sendFTS_multi(CropNum, plusFriendID, snd, altSendType, sndDT, adsYN, msgs, btns, UserID, "", success, error); | ||
}); | ||
//SendFTS multi (requestNum) | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_multi', function (CorpNum, plusFriendID, snd, altSendType, sndDT, adsYN, msgs, btns, UserID, requestNum, success, error) { | ||
var msg = []; | ||
@@ -252,3 +292,3 @@ | ||
this.sendFTS_same(CorpNum, plusFriendID, snd, '', '', altSendType, sndDT, adsYN, msg, btn, UserID, success, error); | ||
this.sendFTS_same(CorpNum, plusFriendID, snd, '', '', altSendType, sndDT, adsYN, msg, btn, UserID, requestNum, success, error); | ||
}); | ||
@@ -258,6 +298,12 @@ | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_same', function (CropNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msgs, btns, success, error) { | ||
this.sendFTS_same(CropNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msgs, btns, "", success, error); | ||
this.sendFTS_same(CropNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msgs, btns, "", "", success, error); | ||
}); | ||
//SendFTS same (UserID) | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_same', function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msgs, btns, UserID, success, error) { | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_same', function (CropNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msgs, btns, UserID, success, error) { | ||
this.sendFTS_same(CropNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msgs, btns, UserID, "", success, error); | ||
}); | ||
//SendFTS same (requestNum) | ||
BaseService.addMethod(KakaoService.prototype, 'sendFTS_same', function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, msgs, btns, UserID, requestNum, success, error) { | ||
if (!CorpNum || 0 === CorpNum.length) { | ||
@@ -276,2 +322,3 @@ this._throwError(-99999999, '팝빌회원 사업자번호가 입력되지 않았습니다.', error); | ||
adsYN: adsYN, | ||
requestNum: requestNum, | ||
msgs: [], | ||
@@ -333,6 +380,12 @@ btns: [] | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_one", function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, imageURL, FilePath, btns, success, error) { | ||
this.sendFMS_one(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, imageURL, FilePath, btns, "", success, error); | ||
this.sendFMS_one(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, imageURL, FilePath, btns, "", "", success, error); | ||
}); | ||
//SenddFMS one (UserID) | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_one", function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, imageURL, FilePath, btns, UserID, success, error) { | ||
this.sendFMS_one(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, imageURL, FilePath, btns, UserID, "", success, error); | ||
}); | ||
//SenddFMS one (requestNum) | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_one", function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, receiver, receiverName, adsYN, imageURL, FilePath, btns, UserID, requestNum, success, error) { | ||
var msg = { | ||
@@ -345,3 +398,3 @@ rcv: receiver, | ||
this.sendFMS_same(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, imageURL, FilePath, msg, btns, UserID, success, error); | ||
this.sendFMS_same(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, imageURL, FilePath, msg, btns, UserID, requestNum, success, error); | ||
}); | ||
@@ -351,7 +404,13 @@ | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_multi", function (CorpNum, plusFriendID, snd, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, success, error) { | ||
this.sendFMS_multi(CorpNum, plusFriendID, snd, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, "", success, error); | ||
this.sendFMS_multi(CorpNum, plusFriendID, snd, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, "", "", success, error); | ||
}); | ||
//SenddFMS multi (UserID) | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_multi", function (CorpNum, plusFriendID, snd, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, UserID, success, error) { | ||
this.sendFMS_multi(CorpNum, plusFriendID, snd, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, UserID, "", success, error); | ||
}); | ||
//SenddFMS multi (requestNum) | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_multi", function (CorpNum, plusFriendID, snd, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, UserID, requestNum, success, error) { | ||
var msg = []; | ||
@@ -397,3 +456,3 @@ | ||
this.sendFMS_same(CorpNum, plusFriendID, snd, '', '', altSendType, sndDT, adsYN, imageURL, FilePath, msg, btn, UserID, success, error); | ||
this.sendFMS_same(CorpNum, plusFriendID, snd, '', '', altSendType, sndDT, adsYN, imageURL, FilePath, msg, btn, UserID, requestNum, success, error); | ||
}); | ||
@@ -403,6 +462,12 @@ | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_same", function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, success, error) { | ||
this.sendFMS_same(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, "", success, error); | ||
this.sendFMS_same(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, "", "", success, error); | ||
}); | ||
//SenddFMS same (UserID) | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_same", function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, UserID, success, error) { | ||
this.sendFMS_same(CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, UserID, "", success, error); | ||
}); | ||
//SenddFMS same (requestNum) | ||
BaseService.addMethod(KakaoService.prototype, "sendFMS_same", function (CorpNum, plusFriendID, snd, content, altContent, altSendType, sndDT, adsYN, imageURL, FilePath, msgs, btns, UserID, requestNum, success, error) { | ||
if (!CorpNum || 0 === CorpNum.length) { | ||
@@ -422,2 +487,3 @@ this._throwError(-99999999, '팝빌회원 사업자번호가 입력되지 않았습니다.', error); | ||
imageURL: imageURL, | ||
requestNum: requestNum, | ||
msgs: [], | ||
@@ -510,2 +576,24 @@ btns: [] | ||
//CancelReserveRN | ||
BaseService.addMethod(KakaoService.prototype, "cancelReserveRN", function (CorpNum, RequestNum, success, error) { | ||
this.cancelReserveRN(CorpNum, RequestNum, '', success, error); | ||
}); | ||
//CancelReserveRN (UserID) | ||
BaseService.addMethod(KakaoService.prototype, "cancelReserveRN", function (CorpNum, RequestNum, UserID, success, error) { | ||
if (!RequestNum || 0 === RequestNum.length) { | ||
this._throwError(-99999999, '카카오톡 전송요청번호를 입력하지 않았습니다.', error); | ||
return; | ||
} | ||
this._executeAction({ | ||
uri: '/KakaoTalk/Cancel/' + RequestNum, | ||
CorpNum: CorpNum, | ||
Method: 'GET', | ||
UserID: UserID, | ||
success: function (response) { | ||
if (success) success(response); | ||
}, | ||
error: error | ||
}); | ||
}); | ||
//GetMessages | ||
@@ -533,2 +621,24 @@ BaseService.addMethod(KakaoService.prototype, "getMessages", function (CorpNum, ReceiptNum, success, error) { | ||
//GetMessagesRN | ||
BaseService.addMethod(KakaoService.prototype, "getMessagesRN", function (CorpNum, RequestNum, success, error) { | ||
this.getMessagesRN(CorpNum, RequestNum, '', success, error); | ||
}); | ||
//GetMessagesRN (UserID) | ||
BaseService.addMethod(KakaoService.prototype, "getMessagesRN", function (CorpNum, RequestNum, UserID, success, error) { | ||
if (!RequestNum || 0 === RequestNum.length) { | ||
this._throwError(-99999999, '카카오톡 전송요청번호를 입력하지 않았습니다.', error); | ||
return; | ||
} | ||
this._executeAction({ | ||
uri: '/KakaoTalk/Get/' + RequestNum, | ||
CorpNum: CorpNum, | ||
Method: 'GET', | ||
UserID: UserID, | ||
success: function (response) { | ||
if (success) success(response); | ||
}, | ||
error: error | ||
}); | ||
}); | ||
//Search | ||
@@ -535,0 +645,0 @@ BaseService.addMethod(KakaoService.prototype, "search", function (CorpNum, SDate, EDate, State, Item, ReserveYN, SenderYN, Page, PerPage, Order, success, error) { |
@@ -252,3 +252,3 @@ var Util = require('util'); | ||
this.sendMessage(MsgType, CorpNum, Sender, SenderName, Subject, Contents, Messages, reserveDT, adsYN, "", success, error) | ||
} | ||
}; | ||
@@ -265,3 +265,3 @@ MessageService.prototype.sendMessage = function (MsgType, CorpNum, Sender, SenderName, Subject, Contents, Messages, reserveDT, adsYN, requestNum, success, error) { | ||
if (!Messages || 0 === Messages.length) { | ||
this._throwError(-99999999, '전송할 메시지가 입력되 않았습니다.', error); | ||
this._throwError(-99999999, '전송할 메시지가 입력되지 않았습니다.', error); | ||
return; | ||
@@ -268,0 +268,0 @@ } |
@@ -109,3 +109,3 @@ var popbill = require('./'); | ||
// requestNum | ||
messageService.sendSMS_multi('1234567890', '07043042992', '동보전송을 하고싶소.', Messages,'', false, '20180810142432', | ||
messageService.sendSMS_multi('1234567890', '07043042992', '동보전송을 하고싶소.', Messages, '', false, '20180903141339', | ||
function(response){ | ||
@@ -119,3 +119,3 @@ console.log(response); | ||
// // LMS 단건 | ||
messageService.sendLMS('1234567890', '07043042992', '010111222', '수신자명', '메시지 제목입니닷', 'LMS 단건전송', '20180811161016', true, '발신자명', '20180810161021', | ||
messageService.sendLMS('1234567890', '07043042992', '010111222', '수신자명', '메시지 제목입니닷', 'LMS 단건전송', '20180811161016', true, '발신자명', '20180903141403', | ||
function(response){ | ||
@@ -239,3 +239,3 @@ console.log(response); | ||
messageService.getMessagesRN('1234567890', '20180810161021', | ||
messageService.getMessagesRN('1234567890', '20180903141403', | ||
function(response){ | ||
@@ -242,0 +242,0 @@ console.log(response); |
{ | ||
"name": "popbill", | ||
"version": "1.8.1", | ||
"version": "1.9.0", | ||
"description": "Popbill API SDK for node. see www.popbill.com", | ||
@@ -25,3 +25,4 @@ "author": "Kim Seongjun <pallet027@gmail.com>", | ||
"dependencies": { | ||
"linkhub": "^1.1.1" | ||
"linkhub": "^1.2.0", | ||
"sync-request":"^2.0.0" | ||
}, | ||
@@ -28,0 +29,0 @@ "repository": { |
# node-popbill | ||
팝빌 node.js SDK v1.8.0 | ||
팝빌 node.js SDK v1.9.0 | ||
@@ -4,0 +4,0 @@ ## Install |
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
321963
7309
2
+ Addedsync-request@^2.0.0
+ Addedasap@2.0.6(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcaseless@0.11.0(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-basic@2.5.1(transitive)
+ Addedhttp-response-object@1.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedos-shim@0.1.3(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpromise@7.3.1(transitive)
+ Addedqs@6.13.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedspawn-sync@1.0.15(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedsync-request@2.2.0(transitive)
+ Addedthen-request@2.2.0(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
Updatedlinkhub@^1.2.0