popbill 1.15.0 → 1.17.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b347042464876afbc516fd2b8571c1395269c887
4
- data.tar.gz: 5b7bc7f16d76d8c91a6fbd920a89ede08ec265a2
3
+ metadata.gz: d46cf7daf370e6ee58bf94b73f89122717483630
4
+ data.tar.gz: 4228a2294343931578ef19fd7f11e7fd4b88d51c
5
5
  SHA512:
6
- metadata.gz: 8fd5891af23fef5febe151b269a0f8df2e1f09536c82221e5af5c8fb80ae85eebf4b9829763bf329203d6b7d3a0d846f4a1e907c72c0a5db19a47eca34da21be
7
- data.tar.gz: 1b10fed0c0ef0270ddb2bbf16105d61167a34790ff6d65f34e492137fba2cf599788875b4d44268362ece13b64d5090b7ce4097a15ae8c874d4e5735e07fe411
6
+ metadata.gz: cb9274d1bc1cf593b1fb7ccb36b2cf074b177e62ecd9104301daa083192ed3ea822b6be05c3f12fdb175821bc60344add4fc9c9db14516d27dd5405fc61e6295
7
+ data.tar.gz: 2b6ce4562a162af8440d1f2728ee6716069bbef6c67e6855f5f98073d4678f844b45e442e239262b5942ef581c6dc1c320daf9fde5b92d8ce8250a6cf8b80806
@@ -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
- return @isTest ? BaseService::ServiceURL_TEST : BaseService::ServiceURL_REAL
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
@@ -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,18 +346,29 @@ 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']
353
353
  end
354
354
 
355
+ def getPDFURL(corpNum, mgtKey, userID = '')
356
+ if corpNum.length != 10
357
+ raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
358
+ end
359
+ if mgtKey.to_s == ''
360
+ raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
361
+ end
362
+
363
+ httpget("/Cashbill/#{mgtKey}?TG=PDF", corpNum, userID)['url']
364
+ end
365
+
355
366
  def getPrintURL(corpNum, mgtKey, userID = '')
356
367
  if corpNum.length != 10
357
368
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
358
369
  end
359
370
  if mgtKey.to_s == ''
360
- raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
371
+ raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
361
372
  end
362
373
 
363
374
  httpget("/Cashbill/#{mgtKey}?TG=PRINT", corpNum, userID)['url']
@@ -368,7 +379,7 @@ class CashbillService < BaseService
368
379
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
369
380
  end
370
381
  if mgtKey.to_s == ''
371
- raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
382
+ raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
372
383
  end
373
384
 
374
385
  httpget("/Cashbill/#{mgtKey}?TG=MAIL", corpNum, userID)['url']
@@ -380,7 +391,7 @@ class CashbillService < BaseService
380
391
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
381
392
  end
382
393
  if mgtKey.to_s == ''
383
- raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
394
+ raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
384
395
  end
385
396
 
386
397
  httpget("/Cashbill/#{mgtKey}?TG=EPRINT", corpNum, userID)['url']
@@ -392,7 +403,7 @@ class CashbillService < BaseService
392
403
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
393
404
  end
394
405
  unless mgtKeyList.any?
395
- raise PopbillException.new('-99999999', '문서관리번호 배열이 올바르지 않습니다.')
406
+ raise PopbillException.new('-99999999', '문서번호 배열이 올바르지 않습니다.')
396
407
  end
397
408
 
398
409
  postData = mgtKeyList.to_json
@@ -425,4 +436,17 @@ class CashbillService < BaseService
425
436
  httppost("/Cashbill/EmailSendConfig?EmailType=#{emailType}&SendYN=#{sendYN}", corpNum, userID)
426
437
  end
427
438
 
439
+ def assignMgtKey(corpNum, itemKey, mgtKey, userID = '')
440
+ if corpNum.length != 10
441
+ raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
442
+ end
443
+ if itemKey.to_s == ''
444
+ raise PopbillException.new('-99999999', '아이템키가 입력되지 않았습니다.')
445
+ end
446
+
447
+ String postDate = "MgtKey=" + mgtKey
448
+
449
+ httppost("/Cashbill/#{itemKey}", corpNum, postDate, "", userID, "application/x-www-form-urlencoded; charset=utf-8")
450
+ end
451
+
428
452
  end # end of CashbillService
@@ -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,40 @@ 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 getViewURL(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=VIEW", corpNum, userID)['url']
373
+ end
374
+
375
+ def getPDFURL(corpNum, itemCode, mgtKey, userID = '')
376
+ if corpNum.length != 10
377
+ raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
378
+ end
379
+ if mgtKey.to_s == ''
380
+ raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
381
+ end
382
+
383
+ httpget("/Statement/#{itemCode}/#{mgtKey}?TG=PDF", corpNum, userID)['url']
384
+ end
385
+
364
386
  def getEPrintURL(corpNum, itemCode, mgtKey, userID = '')
365
387
  if corpNum.length != 10
366
388
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
367
389
  end
368
390
  if mgtKey.to_s == ''
369
- raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
391
+ raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
370
392
  end
371
393
 
372
394
  httpget("/Statement/#{itemCode}/#{mgtKey}?TG=EPRINT", corpNum, userID)['url']
@@ -377,7 +399,7 @@ class StatementService < BaseService
377
399
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
378
400
  end
379
401
  if mgtKey.to_s == ''
380
- raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
402
+ raise PopbillException.new('-99999999', '문서번호가 올바르지 않습니다.')
381
403
  end
382
404
 
383
405
  httpget("/Statement/#{itemCode}/#{mgtKey}?TG=MAIL", corpNum, userID)['url']
@@ -389,7 +411,7 @@ class StatementService < BaseService
389
411
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
390
412
  end
391
413
  unless mgtKeyList.any?
392
- raise PopbillException.new('-99999999', '문서관리번호 배열이 올바르지 않습니다.')
414
+ raise PopbillException.new('-99999999', '문서번호 배열이 올바르지 않습니다.')
393
415
  end
394
416
 
395
417
  postData = mgtKeyList.to_json
@@ -402,7 +424,7 @@ class StatementService < BaseService
402
424
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
403
425
  end
404
426
  if mgtKey.to_s == ''
405
- raise PopbillException.new('-99999999', '문서관리번호가 입력되지 않았습니다.')
427
+ raise PopbillException.new('-99999999', '문서번호가 입력되지 않았습니다.')
406
428
  end
407
429
  if itemCode.to_s == ''
408
430
  raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
@@ -411,7 +433,7 @@ class StatementService < BaseService
411
433
  raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
412
434
  end
413
435
  if subMgtKey.to_s == ''
414
- raise PopbillException.new('-99999999', '전자명세서 문서관리번호가 입력되지 않았습니다.')
436
+ raise PopbillException.new('-99999999', '전자명세서 문서번호가 입력되지 않았습니다.')
415
437
  end
416
438
 
417
439
  postData = {}
@@ -427,7 +449,7 @@ class StatementService < BaseService
427
449
  raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
428
450
  end
429
451
  if mgtKey.to_s == ''
430
- raise PopbillException.new('-99999999', '문서관리번호가 입력되지 않았습니다.')
452
+ raise PopbillException.new('-99999999', '문서번호가 입력되지 않았습니다.')
431
453
  end
432
454
  if itemCode.to_s == ''
433
455
  raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
@@ -436,7 +458,7 @@ class StatementService < BaseService
436
458
  raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
437
459
  end
438
460
  if subMgtKey.to_s == ''
439
- raise PopbillException.new('-99999999', '전자명세서 문서관리번호가 입력되지 않았습니다.')
461
+ raise PopbillException.new('-99999999', '전자명세서 문서번호가 입력되지 않았습니다.')
440
462
  end
441
463
 
442
464
  postData = {}
@@ -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.15.0
4
+ version: 1.17.2
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-07-02 00:00:00.000000000 Z
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.2.0
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.2.0
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