popbill 1.13.0 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/popbill.rb +23 -7
- data/lib/popbill/accountCheck.rb +48 -0
- data/lib/popbill/cashbill.rb +24 -11
- data/lib/popbill/easyFinBank.rb +119 -0
- data/lib/popbill/statement.rb +31 -20
- data/lib/popbill/taxinvoice.rb +54 -30
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22480042655ba50c0689e39cf346023aee42d1de
|
4
|
+
data.tar.gz: a6245d69c619d5f5c8e6bbfa57a0eac100a375a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66ddf09cbde0ca012e8147bbe535e4c48337bee55834b51b4a4f6f310fb8a4f80dda07a894666897d28f738fb79c86e99bbea3663f7bf8134eaf5eb40a8396da
|
7
|
+
data.tar.gz: ef019f24d2b885584c4dcc2828f2e8ff6c95bdc5caa053d0678ae4d69aec62c163a2b90338ab978cafcfcfac3c93f67c972bd9989312ec39c42447f467d2a591
|
data/lib/popbill.rb
CHANGED
@@ -11,10 +11,13 @@ class BaseService
|
|
11
11
|
ServiceID_TEST = "POPBILL_TEST"
|
12
12
|
ServiceURL_REAL = "https://popbill.linkhub.co.kr"
|
13
13
|
ServiceURL_TEST = "https://popbill-test.linkhub.co.kr"
|
14
|
+
ServiceURL_GA_REAL = "https://ga-popbill.linkhub.co.kr"
|
15
|
+
ServiceURL_GA_TEST = "https://ga-popbill-test.linkhub.co.kr"
|
16
|
+
|
14
17
|
POPBILL_APIVersion = "1.0"
|
15
18
|
BOUNDARY = "==POPBILL_RUBY_SDK=="
|
16
19
|
|
17
|
-
attr_accessor :token_table, :scopes, :isTest, :linkhub, :ipRestrictOnOff
|
20
|
+
attr_accessor :token_table, :scopes, :isTest, :linkhub, :ipRestrictOnOff, :useStaticIP
|
18
21
|
|
19
22
|
# Generate Linkhub Class Singleton Instance
|
20
23
|
class << self
|
@@ -24,6 +27,7 @@ class BaseService
|
|
24
27
|
@instance.linkhub = Linkhub.instance(linkID, secretKey)
|
25
28
|
@instance.scopes = ["member"]
|
26
29
|
@instance.ipRestrictOnOff = true
|
30
|
+
@instance.useStaticIP = false
|
27
31
|
|
28
32
|
return @instance
|
29
33
|
end
|
@@ -45,8 +49,17 @@ class BaseService
|
|
45
49
|
@ipRestrictOnOff = value
|
46
50
|
end
|
47
51
|
|
52
|
+
def setUseStaticIP(value)
|
53
|
+
@useStaticIP = value
|
54
|
+
end
|
55
|
+
|
48
56
|
def getServiceURL()
|
49
|
-
|
57
|
+
if @useStaticIP
|
58
|
+
return @isTest ? BaseService::ServiceURL_GA_TEST : BaseService::ServiceURL_GA_REAL
|
59
|
+
else
|
60
|
+
return @isTest ? BaseService::ServiceURL_TEST : BaseService::ServiceURL_REAL
|
61
|
+
end
|
62
|
+
|
50
63
|
end
|
51
64
|
|
52
65
|
def getServiceID()
|
@@ -68,7 +81,7 @@ class BaseService
|
|
68
81
|
else
|
69
82
|
# Token's expireTime must use parse() because time format is hh:mm:ss.SSSZ
|
70
83
|
expireTime = DateTime.parse(targetToken['expiration'])
|
71
|
-
serverUTCTime = DateTime.strptime(@linkhub.getTime())
|
84
|
+
serverUTCTime = DateTime.strptime(@linkhub.getTime(@useStaticIP))
|
72
85
|
refresh = expireTime < serverUTCTime
|
73
86
|
end
|
74
87
|
|
@@ -76,7 +89,7 @@ class BaseService
|
|
76
89
|
begin
|
77
90
|
# getSessionToken from Linkhub
|
78
91
|
targetToken = @linkhub.getSessionToken(
|
79
|
-
@isTest ? ServiceID_TEST : ServiceID_REAL, corpNum, @scopes, @ipRestrictOnOff ? "" : "*")
|
92
|
+
@isTest ? ServiceID_TEST : ServiceID_REAL, corpNum, @scopes, @ipRestrictOnOff ? "" : "*", @useStaticIP)
|
80
93
|
|
81
94
|
rescue LinkhubException => le
|
82
95
|
raise PopbillException.new(le.code, le.message)
|
@@ -112,6 +125,7 @@ class BaseService
|
|
112
125
|
end
|
113
126
|
|
114
127
|
uri = URI(getServiceURL() + url)
|
128
|
+
|
115
129
|
request = Net::HTTP.new(uri.host, 443)
|
116
130
|
request.use_ssl = true
|
117
131
|
|
@@ -224,6 +238,7 @@ class BaseService
|
|
224
238
|
# Add the file Data
|
225
239
|
|
226
240
|
uri = URI(getServiceURL() + url)
|
241
|
+
|
227
242
|
https = Net::HTTP.new(uri.host, 443)
|
228
243
|
https.use_ssl = true
|
229
244
|
Net::HTTP::Post.new(uri)
|
@@ -284,6 +299,7 @@ class BaseService
|
|
284
299
|
# Add the file Data
|
285
300
|
|
286
301
|
uri = URI(getServiceURL() + url)
|
302
|
+
|
287
303
|
https = Net::HTTP.new(uri.host, 443)
|
288
304
|
https.use_ssl = true
|
289
305
|
Net::HTTP::Post.new(uri)
|
@@ -310,7 +326,7 @@ class BaseService
|
|
310
326
|
end
|
311
327
|
|
312
328
|
begin
|
313
|
-
@linkhub.getBalance(getSession_Token(corpNum), getServiceID())
|
329
|
+
@linkhub.getBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP)
|
314
330
|
rescue LinkhubException => le
|
315
331
|
raise PopbillException.new(le.code, le.message)
|
316
332
|
end
|
@@ -323,7 +339,7 @@ class BaseService
|
|
323
339
|
end
|
324
340
|
|
325
341
|
begin
|
326
|
-
@linkhub.getPartnerBalance(getSession_Token(corpNum), getServiceID())
|
342
|
+
@linkhub.getPartnerBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP)
|
327
343
|
rescue LinkhubException => le
|
328
344
|
raise PopbillException.new(le.code, le.message)
|
329
345
|
end
|
@@ -336,7 +352,7 @@ class BaseService
|
|
336
352
|
end
|
337
353
|
|
338
354
|
begin
|
339
|
-
@linkhub.getPartnerURL(getSession_Token(corpNum), getServiceID(), togo)
|
355
|
+
@linkhub.getPartnerURL(getSession_Token(corpNum), getServiceID(), togo, @useStaticIP)
|
340
356
|
rescue LinkhubException => le
|
341
357
|
raise PopbillException.new(le.code, le.message)
|
342
358
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require_relative '../popbill.rb'
|
3
|
+
|
4
|
+
# 팝빌 예금주조회 API Service Implementation
|
5
|
+
class AccountCheckService < BaseService
|
6
|
+
class << self
|
7
|
+
def instance(linkID, secretKey)
|
8
|
+
super(linkID, secretKey)
|
9
|
+
@instance ||= new
|
10
|
+
@instance.addScope("182")
|
11
|
+
return @instance
|
12
|
+
end
|
13
|
+
private :new
|
14
|
+
end
|
15
|
+
|
16
|
+
def getChargeInfo(corpNum, userID = '')
|
17
|
+
if corpNum.length != 10
|
18
|
+
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
|
19
|
+
end
|
20
|
+
httpget("/EasyFin/AccountCheck/ChargeInfo", corpNum, userID)
|
21
|
+
end
|
22
|
+
|
23
|
+
def getUnitCost(corpNum, userID = '')
|
24
|
+
if corpNum.length != 10
|
25
|
+
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
|
26
|
+
end
|
27
|
+
httpget("/EasyFin/AccountCheck/UnitCost", corpNum, userID)['unitCost']
|
28
|
+
end
|
29
|
+
|
30
|
+
def checkAccountInfo(corpNum, bankCode, accountNumber, userID = '')
|
31
|
+
if corpNum.length != 10
|
32
|
+
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
|
33
|
+
end
|
34
|
+
if bankCode.to_s == ''
|
35
|
+
raise PopbillException.new(-99999999, '기관코드가 입력되지 않았습니다.')
|
36
|
+
end
|
37
|
+
|
38
|
+
if accountNumber.to_s == ''
|
39
|
+
raise PopbillException.new(-99999999, '계좌번호가 입력되지 않았습니다.')
|
40
|
+
end
|
41
|
+
|
42
|
+
uri = "/EasyFin/AccountCheck?c=#{bankCode}&n=#{accountNumber}"
|
43
|
+
|
44
|
+
httppost(uri, corpNum, "", "", userID)
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
end # end of FaxService
|
data/lib/popbill/cashbill.rb
CHANGED
@@ -39,7 +39,7 @@ class CashbillService < BaseService
|
|
39
39
|
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
|
40
40
|
end
|
41
41
|
if mgtKey.to_s == ''
|
42
|
-
raise PopbillException.new(-99999999, "현금영수증
|
42
|
+
raise PopbillException.new(-99999999, "현금영수증 문서번호가 입력되지 않았습니다.")
|
43
43
|
end
|
44
44
|
|
45
45
|
begin
|
@@ -232,7 +232,7 @@ class CashbillService < BaseService
|
|
232
232
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
233
233
|
end
|
234
234
|
unless mgtKeyList.any?
|
235
|
-
raise PopbillException.new('-99999999', '
|
235
|
+
raise PopbillException.new('-99999999', '문서번호 배열이 올바르지 않습니다.')
|
236
236
|
end
|
237
237
|
|
238
238
|
postData = mgtKeyList.to_json
|
@@ -257,7 +257,7 @@ class CashbillService < BaseService
|
|
257
257
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
258
258
|
end
|
259
259
|
if mgtKey.to_s == ''
|
260
|
-
raise PopbillException.new('-99999999', '
|
260
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
261
261
|
end
|
262
262
|
|
263
263
|
postData = {}
|
@@ -277,7 +277,7 @@ class CashbillService < BaseService
|
|
277
277
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
278
278
|
end
|
279
279
|
if mgtKey.to_s == ''
|
280
|
-
raise PopbillException.new('-99999999', '
|
280
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
281
281
|
end
|
282
282
|
|
283
283
|
if senderNum.to_s == ''
|
@@ -308,7 +308,7 @@ class CashbillService < BaseService
|
|
308
308
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
309
309
|
end
|
310
310
|
if mgtKey.to_s == ''
|
311
|
-
raise PopbillException.new('-99999999', '
|
311
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
312
312
|
end
|
313
313
|
|
314
314
|
if senderNum.to_s == ''
|
@@ -335,7 +335,7 @@ class CashbillService < BaseService
|
|
335
335
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
336
336
|
end
|
337
337
|
if mgtKey.to_s == ''
|
338
|
-
raise PopbillException.new('-99999999', '
|
338
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
339
339
|
end
|
340
340
|
httpget("/Cashbill/#{mgtKey}/Logs", corpNum, userID)
|
341
341
|
end
|
@@ -346,7 +346,7 @@ class CashbillService < BaseService
|
|
346
346
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
347
347
|
end
|
348
348
|
if mgtKey.to_s == ''
|
349
|
-
raise PopbillException.new('-99999999', '
|
349
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
350
350
|
end
|
351
351
|
|
352
352
|
httpget("/Cashbill/#{mgtKey}?TG=POPUP", corpNum, userID)['url']
|
@@ -357,7 +357,7 @@ class CashbillService < BaseService
|
|
357
357
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
358
358
|
end
|
359
359
|
if mgtKey.to_s == ''
|
360
|
-
raise PopbillException.new('-99999999', '
|
360
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
361
361
|
end
|
362
362
|
|
363
363
|
httpget("/Cashbill/#{mgtKey}?TG=PRINT", corpNum, userID)['url']
|
@@ -368,7 +368,7 @@ class CashbillService < BaseService
|
|
368
368
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
369
369
|
end
|
370
370
|
if mgtKey.to_s == ''
|
371
|
-
raise PopbillException.new('-99999999', '
|
371
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
372
372
|
end
|
373
373
|
|
374
374
|
httpget("/Cashbill/#{mgtKey}?TG=MAIL", corpNum, userID)['url']
|
@@ -380,7 +380,7 @@ class CashbillService < BaseService
|
|
380
380
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
381
381
|
end
|
382
382
|
if mgtKey.to_s == ''
|
383
|
-
raise PopbillException.new('-99999999', '
|
383
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
384
384
|
end
|
385
385
|
|
386
386
|
httpget("/Cashbill/#{mgtKey}?TG=EPRINT", corpNum, userID)['url']
|
@@ -392,7 +392,7 @@ class CashbillService < BaseService
|
|
392
392
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
393
393
|
end
|
394
394
|
unless mgtKeyList.any?
|
395
|
-
raise PopbillException.new('-99999999', '
|
395
|
+
raise PopbillException.new('-99999999', '문서번호 배열이 올바르지 않습니다.')
|
396
396
|
end
|
397
397
|
|
398
398
|
postData = mgtKeyList.to_json
|
@@ -425,4 +425,17 @@ class CashbillService < BaseService
|
|
425
425
|
httppost("/Cashbill/EmailSendConfig?EmailType=#{emailType}&SendYN=#{sendYN}", corpNum, userID)
|
426
426
|
end
|
427
427
|
|
428
|
+
def assignMgtKey(corpNum, itemKey, mgtKey, userID = '')
|
429
|
+
if corpNum.length != 10
|
430
|
+
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
431
|
+
end
|
432
|
+
if itemKey.to_s == ''
|
433
|
+
raise PopbillException.new('-99999999', '아이템키가 입력되지 않았습니다.')
|
434
|
+
end
|
435
|
+
|
436
|
+
String postDate = "MgtKey=" + mgtKey
|
437
|
+
|
438
|
+
httppost("/Cashbill/#{itemKey}", corpNum, postDate, "", userID, "application/x-www-form-urlencoded; charset=utf-8")
|
439
|
+
end
|
440
|
+
|
428
441
|
end # end of CashbillService
|
data/lib/popbill/easyFinBank.rb
CHANGED
@@ -13,6 +13,125 @@ class EasyFinBankService < BaseService
|
|
13
13
|
private :new
|
14
14
|
end
|
15
15
|
|
16
|
+
def registBankAccount(corpNum, bankAccountInfo, userID = "")
|
17
|
+
if corpNum.length != 10
|
18
|
+
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
19
|
+
end
|
20
|
+
|
21
|
+
if bankAccountInfo["BankCode"].to_s == ''
|
22
|
+
raise PopbillException.new('-99999999', '은행코드가 입력되지 않았습니다.')
|
23
|
+
end
|
24
|
+
|
25
|
+
if bankAccountInfo["BankCode"].length != 4
|
26
|
+
raise PopbillException.new('-99999999', '은행코드가 올바르지 않습니다.')
|
27
|
+
end
|
28
|
+
|
29
|
+
if bankAccountInfo["AccountNumber"].to_s == ''
|
30
|
+
raise PopbillException.new('-99999999', '은행 계좌번호가 입력되지 않았습니다.')
|
31
|
+
end
|
32
|
+
|
33
|
+
uri = "/EasyFin/Bank/BankAccount/Regist"
|
34
|
+
|
35
|
+
if bankAccountInfo["UsePeriod"].to_s != ''
|
36
|
+
uri += "?UsePeriod=" + bankAccountInfo["UsePeriod"]
|
37
|
+
end
|
38
|
+
|
39
|
+
httppost(uri, corpNum, bankAccountInfo.to_json, "", userID)
|
40
|
+
end
|
41
|
+
|
42
|
+
def updateBankAccount(corpNum, bankAccountInfo, userID = "")
|
43
|
+
if corpNum.length != 10
|
44
|
+
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
45
|
+
end
|
46
|
+
|
47
|
+
if bankAccountInfo["BankCode"].to_s == ''
|
48
|
+
raise PopbillException.new('-99999999', '은행코드가 입력되지 않았습니다.')
|
49
|
+
end
|
50
|
+
|
51
|
+
if bankAccountInfo["BankCode"].length != 4
|
52
|
+
raise PopbillException.new('-99999999', '은행코드가 올바르지 않습니다.')
|
53
|
+
end
|
54
|
+
|
55
|
+
if bankAccountInfo["AccountNumber"].to_s == ''
|
56
|
+
raise PopbillException.new('-99999999', '은행 계좌번호가 입력되지 않았습니다.')
|
57
|
+
end
|
58
|
+
|
59
|
+
uri = "/EasyFin/Bank/BankAccount/#{bankAccountInfo["BankCode"]}/#{bankAccountInfo["AccountNumber"]}/Update"
|
60
|
+
|
61
|
+
httppost(uri, corpNum, bankAccountInfo.to_json, "", userID)
|
62
|
+
end
|
63
|
+
|
64
|
+
def closeBankAccount(corpNum, bankCode, accountNumber, closeType, userID = "")
|
65
|
+
if corpNum.length != 10
|
66
|
+
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
67
|
+
end
|
68
|
+
|
69
|
+
if bankCode.to_s == ''
|
70
|
+
raise PopbillException.new('-99999999', '은행코드가 입력되지 않았습니다.')
|
71
|
+
end
|
72
|
+
|
73
|
+
if bankCode.length != 4
|
74
|
+
raise PopbillException.new('-99999999', '은행코드가 올바르지 않습니다.')
|
75
|
+
end
|
76
|
+
|
77
|
+
if accountNumber.to_s == ''
|
78
|
+
raise PopbillException.new('-99999999', '은행 계좌번호가 입력되지 않았습니다.')
|
79
|
+
end
|
80
|
+
|
81
|
+
if closeType.to_s == ''
|
82
|
+
raise PopbillException.new('-99999999', '정액제 해지유형이 입력되지 않았습니다.')
|
83
|
+
end
|
84
|
+
|
85
|
+
uri = "/EasyFin/Bank/BankAccount/Close/?BankCode=#{bankCode}&AccountNumber=#{accountNumber}&CloseType=#{closeType}"
|
86
|
+
|
87
|
+
httppost(URI.escape(uri), corpNum, "", "", userID)
|
88
|
+
end
|
89
|
+
|
90
|
+
def revokeCloseBankAccount(corpNum, bankCode, accountNumber, userID = "")
|
91
|
+
if corpNum.length != 10
|
92
|
+
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
93
|
+
end
|
94
|
+
|
95
|
+
if bankCode.to_s == ''
|
96
|
+
raise PopbillException.new('-99999999', '은행코드가 입력되지 않았습니다.')
|
97
|
+
end
|
98
|
+
|
99
|
+
if bankCode.length != 4
|
100
|
+
raise PopbillException.new('-99999999', '은행코드가 올바르지 않습니다.')
|
101
|
+
end
|
102
|
+
|
103
|
+
if accountNumber.to_s == ''
|
104
|
+
raise PopbillException.new('-99999999', '은행 계좌번호가 입력되지 않았습니다.')
|
105
|
+
end
|
106
|
+
|
107
|
+
uri = "/EasyFin/Bank/BankAccount/RevokeClose/?BankCode=#{bankCode}&AccountNumber=#{accountNumber}"
|
108
|
+
|
109
|
+
httppost(uri, corpNum, "", "", userID)
|
110
|
+
end
|
111
|
+
|
112
|
+
def getBankAccountInfo(corpNum, bankCode, accountNumber, userID = "")
|
113
|
+
if corpNum.length != 10
|
114
|
+
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
115
|
+
end
|
116
|
+
|
117
|
+
if bankCode.to_s == ''
|
118
|
+
raise PopbillException.new('-99999999', '은행코드가 입력되지 않았습니다.')
|
119
|
+
end
|
120
|
+
|
121
|
+
if bankCode.length != 4
|
122
|
+
raise PopbillException.new('-99999999', '은행코드가 올바르지 않습니다.')
|
123
|
+
end
|
124
|
+
|
125
|
+
if accountNumber.to_s == ''
|
126
|
+
raise PopbillException.new('-99999999', '은행 계좌번호가 입력되지 않았습니다.')
|
127
|
+
end
|
128
|
+
|
129
|
+
uri = "/EasyFin/Bank/BankAccount/#{bankCode}/#{accountNumber}"
|
130
|
+
|
131
|
+
httpget(uri, corpNum, userID)
|
132
|
+
end
|
133
|
+
|
134
|
+
|
16
135
|
def getChargeInfo(corpNum, userID = "")
|
17
136
|
if corpNum.length != 10
|
18
137
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
data/lib/popbill/statement.rb
CHANGED
@@ -44,7 +44,7 @@ class StatementService < BaseService
|
|
44
44
|
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
|
45
45
|
end
|
46
46
|
if mgtKey.to_s == ''
|
47
|
-
raise PopbillException.new(-99999999, "현금영수증
|
47
|
+
raise PopbillException.new(-99999999, "현금영수증 문서번호가 입력되지 않았습니다.")
|
48
48
|
end
|
49
49
|
|
50
50
|
begin
|
@@ -184,7 +184,7 @@ class StatementService < BaseService
|
|
184
184
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
185
185
|
end
|
186
186
|
if mgtKey.to_s == ''
|
187
|
-
raise PopbillException.new('-99999999', '
|
187
|
+
raise PopbillException.new('-99999999', '문서번호 입력되지 않았습니다.')
|
188
188
|
end
|
189
189
|
|
190
190
|
httpget("/Statement/#{itemCode}/#{mgtKey}", corpNum, userID)
|
@@ -196,7 +196,7 @@ class StatementService < BaseService
|
|
196
196
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
197
197
|
end
|
198
198
|
unless mgtKeyList.any?
|
199
|
-
raise PopbillException.new('-99999999', '
|
199
|
+
raise PopbillException.new('-99999999', '문서번호 배열이 올바르지 않습니다.')
|
200
200
|
end
|
201
201
|
|
202
202
|
postData = mgtKeyList.to_json
|
@@ -210,7 +210,7 @@ class StatementService < BaseService
|
|
210
210
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
211
211
|
end
|
212
212
|
if mgtKey.to_s == ''
|
213
|
-
raise PopbillException.new('-99999999', '
|
213
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
214
214
|
end
|
215
215
|
|
216
216
|
httpget("/Statement/#{itemCode}/#{mgtKey}?Detail", corpNum, userID)
|
@@ -221,7 +221,7 @@ class StatementService < BaseService
|
|
221
221
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
222
222
|
end
|
223
223
|
if mgtKey.to_s == ''
|
224
|
-
raise PopbillException.new('-99999999', '
|
224
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
225
225
|
end
|
226
226
|
if receiverMail.to_s == ''
|
227
227
|
raise PopbillException.new('-99999999', '수신자 메일주소가 올바르지 않습니다.')
|
@@ -240,7 +240,7 @@ class StatementService < BaseService
|
|
240
240
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
241
241
|
end
|
242
242
|
if mgtKey.to_s == ''
|
243
|
-
raise PopbillException.new('-99999999', '
|
243
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
244
244
|
end
|
245
245
|
|
246
246
|
if senderNum.to_s == ''
|
@@ -271,7 +271,7 @@ class StatementService < BaseService
|
|
271
271
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
272
272
|
end
|
273
273
|
if mgtKey.to_s == ''
|
274
|
-
raise PopbillException.new('-99999999', '
|
274
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
275
275
|
end
|
276
276
|
|
277
277
|
if senderNum.to_s == ''
|
@@ -295,7 +295,7 @@ class StatementService < BaseService
|
|
295
295
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
296
296
|
end
|
297
297
|
if mgtKey.to_s == ''
|
298
|
-
raise PopbillException.new('-99999999', '
|
298
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
299
299
|
end
|
300
300
|
|
301
301
|
httpget("/Statement/#{itemCode}/#{mgtKey}/Logs", corpNum, userID)
|
@@ -306,7 +306,7 @@ class StatementService < BaseService
|
|
306
306
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
307
307
|
end
|
308
308
|
if mgtKey.to_s == ''
|
309
|
-
raise PopbillException.new('-99999999', '
|
309
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
310
310
|
end
|
311
311
|
|
312
312
|
httppostfiles("/Statement/#{itemCode}/#{mgtKey}/Files", corpNum, '', [filePath], userID)
|
@@ -317,7 +317,7 @@ class StatementService < BaseService
|
|
317
317
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
318
318
|
end
|
319
319
|
if mgtKey.to_s == ''
|
320
|
-
raise PopbillException.new('-99999999', '
|
320
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
321
321
|
end
|
322
322
|
|
323
323
|
httpget("/Statement/#{itemCode}/#{mgtKey}/Files", corpNum)
|
@@ -329,7 +329,7 @@ class StatementService < BaseService
|
|
329
329
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
330
330
|
end
|
331
331
|
if mgtKey.to_s == ''
|
332
|
-
raise PopbillException.new('-99999999', '
|
332
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
333
333
|
end
|
334
334
|
if fileID.to_s == ''
|
335
335
|
raise PopbillException.new('-99999999', '파일아이디가 입력되지 않았습니다.')
|
@@ -343,7 +343,7 @@ class StatementService < BaseService
|
|
343
343
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
344
344
|
end
|
345
345
|
if mgtKey.to_s == ''
|
346
|
-
raise PopbillException.new('-99999999', '
|
346
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
347
347
|
end
|
348
348
|
|
349
349
|
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=POPUP", corpNum, userID)['url']
|
@@ -355,18 +355,29 @@ class StatementService < BaseService
|
|
355
355
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
356
356
|
end
|
357
357
|
if mgtKey.to_s == ''
|
358
|
-
raise PopbillException.new('-99999999', '
|
358
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
359
359
|
end
|
360
360
|
|
361
361
|
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=PRINT", corpNum, userID)['url']
|
362
362
|
end
|
363
363
|
|
364
|
+
def getPDFURL(corpNum, itemCode, mgtKey, userID = '')
|
365
|
+
if corpNum.length != 10
|
366
|
+
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
367
|
+
end
|
368
|
+
if mgtKey.to_s == ''
|
369
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
370
|
+
end
|
371
|
+
|
372
|
+
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=PDF", corpNum, userID)['url']
|
373
|
+
end
|
374
|
+
|
364
375
|
def getEPrintURL(corpNum, itemCode, mgtKey, userID = '')
|
365
376
|
if corpNum.length != 10
|
366
377
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
367
378
|
end
|
368
379
|
if mgtKey.to_s == ''
|
369
|
-
raise PopbillException.new('-99999999', '
|
380
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
370
381
|
end
|
371
382
|
|
372
383
|
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=EPRINT", corpNum, userID)['url']
|
@@ -377,7 +388,7 @@ class StatementService < BaseService
|
|
377
388
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
378
389
|
end
|
379
390
|
if mgtKey.to_s == ''
|
380
|
-
raise PopbillException.new('-99999999', '
|
391
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
381
392
|
end
|
382
393
|
|
383
394
|
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=MAIL", corpNum, userID)['url']
|
@@ -389,7 +400,7 @@ class StatementService < BaseService
|
|
389
400
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
390
401
|
end
|
391
402
|
unless mgtKeyList.any?
|
392
|
-
raise PopbillException.new('-99999999', '
|
403
|
+
raise PopbillException.new('-99999999', '문서번호 배열이 올바르지 않습니다.')
|
393
404
|
end
|
394
405
|
|
395
406
|
postData = mgtKeyList.to_json
|
@@ -402,7 +413,7 @@ class StatementService < BaseService
|
|
402
413
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
403
414
|
end
|
404
415
|
if mgtKey.to_s == ''
|
405
|
-
raise PopbillException.new('-99999999', '
|
416
|
+
raise PopbillException.new('-99999999', '문서번호가 입력되지 않았습니다.')
|
406
417
|
end
|
407
418
|
if itemCode.to_s == ''
|
408
419
|
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
|
@@ -411,7 +422,7 @@ class StatementService < BaseService
|
|
411
422
|
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
|
412
423
|
end
|
413
424
|
if subMgtKey.to_s == ''
|
414
|
-
raise PopbillException.new('-99999999', '전자명세서
|
425
|
+
raise PopbillException.new('-99999999', '전자명세서 문서번호가 입력되지 않았습니다.')
|
415
426
|
end
|
416
427
|
|
417
428
|
postData = {}
|
@@ -427,7 +438,7 @@ class StatementService < BaseService
|
|
427
438
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
428
439
|
end
|
429
440
|
if mgtKey.to_s == ''
|
430
|
-
raise PopbillException.new('-99999999', '
|
441
|
+
raise PopbillException.new('-99999999', '문서번호가 입력되지 않았습니다.')
|
431
442
|
end
|
432
443
|
if itemCode.to_s == ''
|
433
444
|
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
|
@@ -436,7 +447,7 @@ class StatementService < BaseService
|
|
436
447
|
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
|
437
448
|
end
|
438
449
|
if subMgtKey.to_s == ''
|
439
|
-
raise PopbillException.new('-99999999', '전자명세서
|
450
|
+
raise PopbillException.new('-99999999', '전자명세서 문서번호가 입력되지 않았습니다.')
|
440
451
|
end
|
441
452
|
|
442
453
|
postData = {}
|
data/lib/popbill/taxinvoice.rb
CHANGED
@@ -54,7 +54,7 @@ class TaxinvoiceService < BaseService
|
|
54
54
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
55
55
|
end
|
56
56
|
if mgtKey.to_s == ''
|
57
|
-
raise PopbillException.new('-99999999', '
|
57
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
58
58
|
end
|
59
59
|
|
60
60
|
begin
|
@@ -116,7 +116,7 @@ class TaxinvoiceService < BaseService
|
|
116
116
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
117
117
|
end
|
118
118
|
if mgtKey.to_s == ''
|
119
|
-
raise PopbillException.new('-99999999', '
|
119
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
120
120
|
end
|
121
121
|
postData = taxinvoice.to_json
|
122
122
|
|
@@ -129,7 +129,7 @@ class TaxinvoiceService < BaseService
|
|
129
129
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
130
130
|
end
|
131
131
|
if mgtKey.to_s == ''
|
132
|
-
raise PopbillException.new('-99999999', '
|
132
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
133
133
|
end
|
134
134
|
|
135
135
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, userID)
|
@@ -154,7 +154,7 @@ class TaxinvoiceService < BaseService
|
|
154
154
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
155
155
|
end
|
156
156
|
if mgtKey.to_s == ''
|
157
|
-
raise PopbillException.new('-99999999', '
|
157
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
158
158
|
end
|
159
159
|
|
160
160
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?Detail", corpNum, userID)
|
@@ -178,7 +178,7 @@ class TaxinvoiceService < BaseService
|
|
178
178
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
179
179
|
end
|
180
180
|
if mgtKey.to_s == ''
|
181
|
-
raise PopbillException.new('-99999999', '
|
181
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
182
182
|
end
|
183
183
|
|
184
184
|
postData = {}
|
@@ -201,7 +201,7 @@ class TaxinvoiceService < BaseService
|
|
201
201
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
202
202
|
end
|
203
203
|
if mgtKey.to_s == ''
|
204
|
-
raise PopbillException.new('-99999999', '
|
204
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
205
205
|
end
|
206
206
|
|
207
207
|
postData = {}
|
@@ -220,7 +220,7 @@ class TaxinvoiceService < BaseService
|
|
220
220
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
221
221
|
end
|
222
222
|
if mgtKey.to_s == ''
|
223
|
-
raise PopbillException.new('-99999999', '
|
223
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
224
224
|
end
|
225
225
|
|
226
226
|
postData = {}
|
@@ -239,7 +239,7 @@ class TaxinvoiceService < BaseService
|
|
239
239
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
240
240
|
end
|
241
241
|
if mgtKey.to_s == ''
|
242
|
-
raise PopbillException.new('-99999999', '
|
242
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
243
243
|
end
|
244
244
|
|
245
245
|
postData = {}
|
@@ -258,7 +258,7 @@ class TaxinvoiceService < BaseService
|
|
258
258
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
259
259
|
end
|
260
260
|
if mgtKey.to_s == ''
|
261
|
-
raise PopbillException.new('-99999999', '
|
261
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
262
262
|
end
|
263
263
|
|
264
264
|
postData = {}
|
@@ -286,7 +286,7 @@ class TaxinvoiceService < BaseService
|
|
286
286
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
287
287
|
end
|
288
288
|
if mgtKey.to_s == ''
|
289
|
-
raise PopbillException.new('-99999999', '
|
289
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
290
290
|
end
|
291
291
|
|
292
292
|
postData = {}
|
@@ -319,7 +319,7 @@ class TaxinvoiceService < BaseService
|
|
319
319
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
320
320
|
end
|
321
321
|
if mgtKey.to_s == ''
|
322
|
-
raise PopbillException.new('-99999999', '
|
322
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
323
323
|
end
|
324
324
|
|
325
325
|
postData = {}
|
@@ -338,7 +338,7 @@ class TaxinvoiceService < BaseService
|
|
338
338
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
339
339
|
end
|
340
340
|
if mgtKey.to_s == ''
|
341
|
-
raise PopbillException.new('-99999999', '
|
341
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
342
342
|
end
|
343
343
|
|
344
344
|
postData = {}
|
@@ -357,7 +357,7 @@ class TaxinvoiceService < BaseService
|
|
357
357
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
358
358
|
end
|
359
359
|
if mgtKey.to_s == ''
|
360
|
-
raise PopbillException.new('-99999999', '
|
360
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
361
361
|
end
|
362
362
|
|
363
363
|
postData = {}
|
@@ -377,7 +377,7 @@ class TaxinvoiceService < BaseService
|
|
377
377
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
378
378
|
end
|
379
379
|
if mgtKey.to_s == ''
|
380
|
-
raise PopbillException.new('-99999999', '
|
380
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
381
381
|
end
|
382
382
|
|
383
383
|
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, '', "NTS", userID)
|
@@ -389,7 +389,7 @@ class TaxinvoiceService < BaseService
|
|
389
389
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
390
390
|
end
|
391
391
|
if mgtKey.to_s == ''
|
392
|
-
raise PopbillException.new('-99999999', '
|
392
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
393
393
|
end
|
394
394
|
|
395
395
|
postData = {}
|
@@ -408,7 +408,7 @@ class TaxinvoiceService < BaseService
|
|
408
408
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
409
409
|
end
|
410
410
|
if mgtKey.to_s == ''
|
411
|
-
raise PopbillException.new('-99999999', '
|
411
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
412
412
|
end
|
413
413
|
|
414
414
|
if senderNum.to_s == ''
|
@@ -439,7 +439,7 @@ class TaxinvoiceService < BaseService
|
|
439
439
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
440
440
|
end
|
441
441
|
if mgtKey.to_s == ''
|
442
|
-
raise PopbillException.new('-99999999', '
|
442
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
443
443
|
end
|
444
444
|
|
445
445
|
if senderNum.to_s == ''
|
@@ -465,7 +465,7 @@ class TaxinvoiceService < BaseService
|
|
465
465
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
466
466
|
end
|
467
467
|
if mgtKey.to_s == ''
|
468
|
-
raise PopbillException.new('-99999999', '
|
468
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
469
469
|
end
|
470
470
|
|
471
471
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/Logs", corpNum, userID)
|
@@ -477,7 +477,7 @@ class TaxinvoiceService < BaseService
|
|
477
477
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
478
478
|
end
|
479
479
|
if mgtKey.to_s == ''
|
480
|
-
raise PopbillException.new('-99999999', '
|
480
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
481
481
|
end
|
482
482
|
|
483
483
|
httppostfiles("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/Files", corpNum, '', [filePath], userID)
|
@@ -489,7 +489,7 @@ class TaxinvoiceService < BaseService
|
|
489
489
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
490
490
|
end
|
491
491
|
if mgtKey.to_s == ''
|
492
|
-
raise PopbillException.new('-99999999', '
|
492
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
493
493
|
end
|
494
494
|
|
495
495
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/Files", corpNum)
|
@@ -501,7 +501,7 @@ class TaxinvoiceService < BaseService
|
|
501
501
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
502
502
|
end
|
503
503
|
if mgtKey.to_s == ''
|
504
|
-
raise PopbillException.new('-99999999', '
|
504
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
505
505
|
end
|
506
506
|
if fileID.to_s == ''
|
507
507
|
raise PopbillException.new('-99999999', '파일아이디가 입력되지 않았습니다.')
|
@@ -515,7 +515,7 @@ class TaxinvoiceService < BaseService
|
|
515
515
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
516
516
|
end
|
517
517
|
if mgtKey.to_s == ''
|
518
|
-
raise PopbillException.new('-99999999', '
|
518
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
519
519
|
end
|
520
520
|
|
521
521
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=POPUP", corpNum, userID)['url']
|
@@ -526,18 +526,29 @@ class TaxinvoiceService < BaseService
|
|
526
526
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
527
527
|
end
|
528
528
|
if mgtKey.to_s == ''
|
529
|
-
raise PopbillException.new('-99999999', '
|
529
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
530
530
|
end
|
531
531
|
|
532
532
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=PRINT", corpNum, userID)['url']
|
533
533
|
end
|
534
534
|
|
535
|
+
def getPDFURL(corpNum, mgtKeyType, mgtKey, userID = '')
|
536
|
+
if corpNum.length != 10
|
537
|
+
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
538
|
+
end
|
539
|
+
if mgtKey.to_s == ''
|
540
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
541
|
+
end
|
542
|
+
|
543
|
+
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=PDF", corpNum, userID)['url']
|
544
|
+
end
|
545
|
+
|
535
546
|
def getViewURL(corpNum, mgtKeyType, mgtKey, userID = '')
|
536
547
|
if corpNum.length != 10
|
537
548
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
538
549
|
end
|
539
550
|
if mgtKey.to_s == ''
|
540
|
-
raise PopbillException.new('-99999999', '
|
551
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
541
552
|
end
|
542
553
|
|
543
554
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=VIEW", corpNum, userID)['url']
|
@@ -548,7 +559,7 @@ class TaxinvoiceService < BaseService
|
|
548
559
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
549
560
|
end
|
550
561
|
if mgtKey.to_s == ''
|
551
|
-
raise PopbillException.new('-99999999', '
|
562
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
552
563
|
end
|
553
564
|
|
554
565
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=EPRINT", corpNum, userID)['url']
|
@@ -559,7 +570,7 @@ class TaxinvoiceService < BaseService
|
|
559
570
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
560
571
|
end
|
561
572
|
if mgtKey.to_s == ''
|
562
|
-
raise PopbillException.new('-99999999', '
|
573
|
+
raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
|
563
574
|
end
|
564
575
|
|
565
576
|
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=MAIL", corpNum, userID)['url']
|
@@ -579,7 +590,8 @@ class TaxinvoiceService < BaseService
|
|
579
590
|
|
580
591
|
|
581
592
|
def search(corpNum, mgtKeyType, dType, sDate, eDate, state, type, taxType, lateOnly,
|
582
|
-
taxRegIDYN, taxRegIDType, taxRegID, page, perPage, order, queryString, userID = '', interOPYN = '', issueType = []
|
593
|
+
taxRegIDYN, taxRegIDType, taxRegID, page, perPage, order, queryString, userID = '', interOPYN = '', issueType = [],
|
594
|
+
regType = [], closeDownState = [], mgtKey = '')
|
583
595
|
if corpNum.length != 10
|
584
596
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
585
597
|
end
|
@@ -588,11 +600,11 @@ class TaxinvoiceService < BaseService
|
|
588
600
|
end
|
589
601
|
|
590
602
|
if sDate.to_s == ''
|
591
|
-
raise PopbillException.new('-99999999', '시작일자가 입력되지 않았습니다.')
|
603
|
+
raise PopbillException.new('-99999999', '검색기간 시작일자가 입력되지 않았습니다.')
|
592
604
|
end
|
593
605
|
|
594
606
|
if eDate.to_s == ''
|
595
|
-
raise PopbillException.new('-99999999', '종료일자가 입력되지 않았습니다.')
|
607
|
+
raise PopbillException.new('-99999999', '검색기간 종료일자가 입력되지 않았습니다.')
|
596
608
|
end
|
597
609
|
|
598
610
|
uri = "/Taxinvoice/#{mgtKeyType}?DType=#{dType}&SDate=#{sDate}&EDate=#{eDate}"
|
@@ -610,6 +622,14 @@ class TaxinvoiceService < BaseService
|
|
610
622
|
uri += "&IssueType=" + issueType.join(',')
|
611
623
|
end
|
612
624
|
|
625
|
+
if regType.length > 0
|
626
|
+
uri += "&RegType=" + regType.join(',')
|
627
|
+
end
|
628
|
+
|
629
|
+
if closeDownState.length > 0
|
630
|
+
uri += "&CloseDownState=" + closeDownState.join(',')
|
631
|
+
end
|
632
|
+
|
613
633
|
if lateOnly.to_s != ''
|
614
634
|
uri += "&LateOnly=" + lateOnly
|
615
635
|
end
|
@@ -622,6 +642,10 @@ class TaxinvoiceService < BaseService
|
|
622
642
|
uri += "&QString=" + queryString
|
623
643
|
end
|
624
644
|
|
645
|
+
if mgtKey.to_s != ''
|
646
|
+
uri += "&MgtKey=" + mgtKey
|
647
|
+
end
|
648
|
+
|
625
649
|
httpget(URI.escape(uri), corpNum, userID)
|
626
650
|
|
627
651
|
end
|
@@ -676,7 +700,7 @@ class TaxinvoiceService < BaseService
|
|
676
700
|
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
|
677
701
|
end
|
678
702
|
if itemKey.to_s == ''
|
679
|
-
raise PopbillException.new('-99999999', '
|
703
|
+
raise PopbillException.new('-99999999', '아이템키가 입력되지 않았습니다.')
|
680
704
|
end
|
681
705
|
|
682
706
|
String postDate = "MgtKey=" + mgtKey
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: popbill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linkhub Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: linkhub
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.3.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.3.1
|
27
27
|
description: Popbill API SDK
|
28
28
|
email: code@linkhub.co.kr
|
29
29
|
executables: []
|
@@ -31,6 +31,7 @@ extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
33
|
- lib/popbill.rb
|
34
|
+
- lib/popbill/accountCheck.rb
|
34
35
|
- lib/popbill/cashbill.rb
|
35
36
|
- lib/popbill/closedown.rb
|
36
37
|
- lib/popbill/easyFinBank.rb
|