popbill 1.16.0 → 1.18.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/cashbill.rb +35 -11
- data/lib/popbill/statement.rb +42 -20
- data/lib/popbill/taxinvoice.rb +54 -30
- data/lib/popbill.rb +18 -9
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc926cf9e22f8c56b61027c043967839faddbcd
|
4
|
+
data.tar.gz: bb08081f9a52a1f8b41d59a663b21fe5b481a2aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdb8434bc6221ad5bf769acf49b90429211c12bde3eceb58a5bdcf28957f62d69dea320202261d2788bb8fead836873d81080ee1012efd981bc91de3d91e7e1c
|
7
|
+
data.tar.gz: 98cc810dd4a709899fb154c10a5b3fb2553561d51464b75aeb0d8d8660fcee90d8eed3951af919f14b73bdfd695c366bf450b731cd4ac4335644fb056a62d5ee
|
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,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
|
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,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 = {}
|
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
|
data/lib/popbill.rb
CHANGED
@@ -11,13 +11,15 @@ 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_Static_REAL = "https://static-popbill.linkhub.co.kr"
|
15
|
+
ServiceURL_Static_TEST = "https://static-popbill-test.linkhub.co.kr"
|
14
16
|
ServiceURL_GA_REAL = "https://ga-popbill.linkhub.co.kr"
|
15
17
|
ServiceURL_GA_TEST = "https://ga-popbill-test.linkhub.co.kr"
|
16
18
|
|
17
19
|
POPBILL_APIVersion = "1.0"
|
18
20
|
BOUNDARY = "==POPBILL_RUBY_SDK=="
|
19
21
|
|
20
|
-
attr_accessor :token_table, :scopes, :isTest, :linkhub, :ipRestrictOnOff, :useStaticIP
|
22
|
+
attr_accessor :token_table, :scopes, :isTest, :linkhub, :ipRestrictOnOff, :useStaticIP, :useGAIP
|
21
23
|
|
22
24
|
# Generate Linkhub Class Singleton Instance
|
23
25
|
class << self
|
@@ -28,6 +30,7 @@ class BaseService
|
|
28
30
|
@instance.scopes = ["member"]
|
29
31
|
@instance.ipRestrictOnOff = true
|
30
32
|
@instance.useStaticIP = false
|
33
|
+
@instance.useGAIP = false
|
31
34
|
|
32
35
|
return @instance
|
33
36
|
end
|
@@ -53,9 +56,15 @@ class BaseService
|
|
53
56
|
@useStaticIP = value
|
54
57
|
end
|
55
58
|
|
59
|
+
def setUseGAIP(value)
|
60
|
+
@useGAIP = value
|
61
|
+
end
|
62
|
+
|
56
63
|
def getServiceURL()
|
57
|
-
if @
|
58
|
-
|
64
|
+
if @useGAIP
|
65
|
+
return @isTest ? BaseService::ServiceURL_GA_TEST : BaseService::ServiceURL_GA_REAL
|
66
|
+
elsif @useStaticIP
|
67
|
+
return @isTest ? BaseService::ServiceURL_Static_TEST : BaseService::ServiceURL_Static_REAL
|
59
68
|
else
|
60
69
|
return @isTest ? BaseService::ServiceURL_TEST : BaseService::ServiceURL_REAL
|
61
70
|
end
|
@@ -81,7 +90,7 @@ class BaseService
|
|
81
90
|
else
|
82
91
|
# Token's expireTime must use parse() because time format is hh:mm:ss.SSSZ
|
83
92
|
expireTime = DateTime.parse(targetToken['expiration'])
|
84
|
-
serverUTCTime = DateTime.strptime(@linkhub.getTime(@useStaticIP))
|
93
|
+
serverUTCTime = DateTime.strptime(@linkhub.getTime(@useStaticIP, @useGAIP))
|
85
94
|
refresh = expireTime < serverUTCTime
|
86
95
|
end
|
87
96
|
|
@@ -89,7 +98,7 @@ class BaseService
|
|
89
98
|
begin
|
90
99
|
# getSessionToken from Linkhub
|
91
100
|
targetToken = @linkhub.getSessionToken(
|
92
|
-
@isTest ? ServiceID_TEST : ServiceID_REAL, corpNum, @scopes, @ipRestrictOnOff ? "" : "*", @useStaticIP)
|
101
|
+
@isTest ? ServiceID_TEST : ServiceID_REAL, corpNum, @scopes, @ipRestrictOnOff ? "" : "*", @useStaticIP, @useGAIP)
|
93
102
|
|
94
103
|
rescue LinkhubException => le
|
95
104
|
raise PopbillException.new(le.code, le.message)
|
@@ -299,7 +308,7 @@ class BaseService
|
|
299
308
|
# Add the file Data
|
300
309
|
|
301
310
|
uri = URI(getServiceURL() + url)
|
302
|
-
|
311
|
+
|
303
312
|
https = Net::HTTP.new(uri.host, 443)
|
304
313
|
https.use_ssl = true
|
305
314
|
Net::HTTP::Post.new(uri)
|
@@ -326,7 +335,7 @@ class BaseService
|
|
326
335
|
end
|
327
336
|
|
328
337
|
begin
|
329
|
-
@linkhub.getBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP)
|
338
|
+
@linkhub.getBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP, @useGAIP)
|
330
339
|
rescue LinkhubException => le
|
331
340
|
raise PopbillException.new(le.code, le.message)
|
332
341
|
end
|
@@ -339,7 +348,7 @@ class BaseService
|
|
339
348
|
end
|
340
349
|
|
341
350
|
begin
|
342
|
-
@linkhub.getPartnerBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP)
|
351
|
+
@linkhub.getPartnerBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP, @useGAIP)
|
343
352
|
rescue LinkhubException => le
|
344
353
|
raise PopbillException.new(le.code, le.message)
|
345
354
|
end
|
@@ -352,7 +361,7 @@ class BaseService
|
|
352
361
|
end
|
353
362
|
|
354
363
|
begin
|
355
|
-
@linkhub.getPartnerURL(getSession_Token(corpNum), getServiceID(), togo, @useStaticIP)
|
364
|
+
@linkhub.getPartnerURL(getSession_Token(corpNum), getServiceID(), togo, @useStaticIP, @useGAIP)
|
356
365
|
rescue LinkhubException => le
|
357
366
|
raise PopbillException.new(le.code, le.message)
|
358
367
|
end
|
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.18.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:
|
11
|
+
date: 2021-09-14 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.4.0
|
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.4.0
|
27
27
|
description: Popbill API SDK
|
28
28
|
email: code@linkhub.co.kr
|
29
29
|
executables: []
|