barocert 1.2.3 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/barocert/navercert.rb +101 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5c437f82ff3ad89c6bdbbf6b02a114f66f920980245ad0666834d4727bdc730
|
4
|
+
data.tar.gz: 1216ae191dcbe95905c42ca31a62c5a9a24a0b5c893bfc28b274473870689651
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 317ed552d66e505a1d62cdfcc3d0c1749773f6a2e0ff7a63825a10a4b9a38262c9fbf31d6a931798ce4f502c0342fa1a3f9263704961a836b6981f2a194f5cc2
|
7
|
+
data.tar.gz: a3f6381149f7f936eb739cb05ae33c4b62ee7fa3e883a8982b20c246c00b33ef18aee7e7e9e97ef1d56e0ae712dc47a409ed63f93f11ca9bb7dfb60f80e0601c
|
data/lib/barocert/navercert.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require_relative '../barocert.rb'
|
3
|
+
require 'digest'
|
3
4
|
require 'openssl'
|
4
5
|
require 'base64'
|
5
6
|
|
@@ -13,11 +14,17 @@ class NavercertService < BarocertService
|
|
13
14
|
@instance.addScope("421")
|
14
15
|
@instance.addScope("422")
|
15
16
|
@instance.addScope("423")
|
17
|
+
@instance.addScope("424")
|
16
18
|
return @instance
|
17
19
|
end
|
18
20
|
private :new
|
19
21
|
end
|
20
22
|
|
23
|
+
def _sha256_base64url(target)
|
24
|
+
hashed = Digest::SHA256.digest(target)
|
25
|
+
return Base64.urlsafe_encode64(hashed, padding:false)
|
26
|
+
end
|
27
|
+
|
21
28
|
def _encrypt(plaintext)
|
22
29
|
return aes256gcm(plaintext, @linkhub._secretKey)
|
23
30
|
end
|
@@ -338,6 +345,100 @@ class NavercertService < BarocertService
|
|
338
345
|
|
339
346
|
httppost("/NAVER/MultiSign/#{clientCode}/#{receiptID}")
|
340
347
|
end
|
348
|
+
|
349
|
+
def requestCMS(clientCode, cms)
|
350
|
+
|
351
|
+
if clientCode.to_s == ''
|
352
|
+
raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
|
353
|
+
end
|
354
|
+
if clientCode.is_i? == false
|
355
|
+
raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
|
356
|
+
end
|
357
|
+
if clientCode.length != 12
|
358
|
+
raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
|
359
|
+
end
|
360
|
+
if cms.nil?
|
361
|
+
raise BarocertException.new('-99999999', '본인인증 서명요청 정보가 입력되지 않았습니다.')
|
362
|
+
end
|
363
|
+
if cms["receiverHP"].to_s == ''
|
364
|
+
raise BarocertException.new('-99999999', '수신자 휴대폰번호가 입력되지 않았습니다.')
|
365
|
+
end
|
366
|
+
if cms["receiverName"].to_s == ''
|
367
|
+
raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
|
368
|
+
end
|
369
|
+
if cms["receiverBirthday"].to_s == ''
|
370
|
+
raise BarocertException.new('-99999999', '생년월일이 입력되지 않았습니다.')
|
371
|
+
end
|
372
|
+
if cms["callCenterNum"].to_s == ''
|
373
|
+
raise BarocertException.new('-99999999', '고객센터 연락처가 입력되지 않았습니다.')
|
374
|
+
end
|
375
|
+
if cms["expireIn"].to_s == ''
|
376
|
+
raise BarocertException.new('-99999999', '만료시간이 입력되지 않았습니다.')
|
377
|
+
end
|
378
|
+
if cms["requestCorp"].to_s == ''
|
379
|
+
raise BarocertException.new('-99999999', '청구기관명이 입력되지 않았습니다.')
|
380
|
+
end
|
381
|
+
if cms["bankName"].to_s == ''
|
382
|
+
raise BarocertException.new('-99999999', '은행명이 입력되지 않았습니다.')
|
383
|
+
end
|
384
|
+
if cms["bankAccountNum"].to_s == ''
|
385
|
+
raise BarocertException.new('-99999999', '계좌번호가 입력되지 않았습니다.')
|
386
|
+
end
|
387
|
+
if cms["bankAccountName"].to_s == ''
|
388
|
+
raise BarocertException.new('-99999999', '예금주명이 입력되지 않았습니다.')
|
389
|
+
end
|
390
|
+
if cms["bankAccountBirthday"].to_s == ''
|
391
|
+
raise BarocertException.new('-99999999', '예금주 생년월일이 입력되지 않았습니다.')
|
392
|
+
end
|
393
|
+
httppost("/NAVER/CMS/#{clientCode}", cms.to_json)
|
394
|
+
end
|
395
|
+
|
396
|
+
def getCMSStatus(clientCode, receiptID)
|
397
|
+
puts receiptID
|
398
|
+
if clientCode.to_s == ''
|
399
|
+
raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
|
400
|
+
end
|
401
|
+
if clientCode.is_i? == false
|
402
|
+
raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
|
403
|
+
end
|
404
|
+
if clientCode.length != 12
|
405
|
+
raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
|
406
|
+
end
|
407
|
+
if receiptID.to_s == ''
|
408
|
+
raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
|
409
|
+
end
|
410
|
+
if receiptID.is_i? == false
|
411
|
+
raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
|
412
|
+
end
|
413
|
+
if receiptID.length != 32
|
414
|
+
raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
|
415
|
+
end
|
416
|
+
|
417
|
+
httpget("/NAVER/CMS/#{clientCode}/#{receiptID}")
|
418
|
+
end
|
419
|
+
|
420
|
+
def verifyCMS(clientCode, receiptID)
|
421
|
+
if clientCode.to_s == ''
|
422
|
+
raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
|
423
|
+
end
|
424
|
+
if clientCode.is_i? == false
|
425
|
+
raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
|
426
|
+
end
|
427
|
+
if clientCode.length != 12
|
428
|
+
raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
|
429
|
+
end
|
430
|
+
if receiptID.to_s == ''
|
431
|
+
raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
|
432
|
+
end
|
433
|
+
if receiptID.is_i? == false
|
434
|
+
raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
|
435
|
+
end
|
436
|
+
if receiptID.length != 32
|
437
|
+
raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
|
438
|
+
end
|
439
|
+
|
440
|
+
httppost("/NAVER/CMS/#{clientCode}/#{receiptID}")
|
441
|
+
end
|
341
442
|
end
|
342
443
|
|
343
444
|
class String
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barocert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.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: 2023-
|
11
|
+
date: 2023-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: linkhub
|