barocert 1.3.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf7b604b1bbf8dafc4d899209c4dea9db0195b163c788ce55476313d5c8a5c94
4
- data.tar.gz: f795573b59f420f2fcf5e4804ef8ec31b7eff4418ff8d09ac9377c433256ce2f
3
+ metadata.gz: 355127d39a5e957956c34bd70fde08fa7510ca816c4b046fb9051f499d88464b
4
+ data.tar.gz: 2ede115c19bdd87653cc4076650d40f79ccfdd43ae13fd81c9a8525dff3126b6
5
5
  SHA512:
6
- metadata.gz: 8f18d287ddd55c44cab41e20d4b0cfaedab5d267d1f1212250d428a5123fec55d5eea12dc7c7e03dd08c26da5eff343baf7a29002b506952f6d2c7423037f28d
7
- data.tar.gz: 4ac4577cc71791d00abff1868cfb8e69b64ec9093ea9c9931ddccbbdbe1486aec0a56ebe660999c613cacdaa466ce2bf0b059259f8d5adba33ade541f3f7b164
6
+ metadata.gz: d7f236a67ed09fd3dbc08f3444310aab2e56ddd0ad7f4b45673adaefba13ce7c81dd5c1bb9525233596362099f792f71686558528c24b77b7724a6e939eb1081
7
+ data.tar.gz: 9fd10b831bb7d8db6696b0eb53fc2f3cea0f0aff768169bff73b7f48ee104adf22a20fde539cd01cae17b42ca4f7c493b6d7d46a49a0438aec272aec841df923
@@ -155,7 +155,7 @@ class KakaocertService < BarocertService
155
155
  raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
156
156
  end
157
157
 
158
- httppost("/KAKAO/Identity/#{clientCode}/#{receiptID}")
158
+ httppost("/KAKAO/Identity/Verify/#{clientCode}/#{receiptID}")
159
159
  end
160
160
 
161
161
  def requestSign(clientCode, sign)
@@ -242,7 +242,7 @@ class KakaocertService < BarocertService
242
242
  raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
243
243
  end
244
244
 
245
- httppost("/KAKAO/Sign/#{clientCode}/#{receiptID}")
245
+ httppost("/KAKAO/Sign/Verify/#{clientCode}/#{receiptID}")
246
246
  end
247
247
 
248
248
  def requestMultiSign(clientCode, multiSign)
@@ -334,7 +334,7 @@ class KakaocertService < BarocertService
334
334
  raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
335
335
  end
336
336
 
337
- httppost("/KAKAO/MultiSign/#{clientCode}/#{receiptID}")
337
+ httppost("/KAKAO/MultiSign/Verify/#{clientCode}/#{receiptID}")
338
338
  end
339
339
 
340
340
  def requestCMS(clientCode, cms)
@@ -438,7 +438,7 @@ class KakaocertService < BarocertService
438
438
  raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
439
439
  end
440
440
 
441
- httppost("/KAKAO/CMS/#{clientCode}/#{receiptID}")
441
+ httppost("/KAKAO/CMS/Verify/#{clientCode}/#{receiptID}")
442
442
  end
443
443
 
444
444
  def verifyLogin(clientCode, txID)
@@ -455,7 +455,7 @@ class KakaocertService < BarocertService
455
455
  raise BarocertException.new('-99999999', '트랜잭션 아이디가 입력되지 않았습니다.')
456
456
  end
457
457
 
458
- httppost("/KAKAO/Login/#{clientCode}/#{txID}")
458
+ httppost("/KAKAO/Login/Verify/#{clientCode}/#{txID}")
459
459
  end
460
460
  end
461
461
 
@@ -155,7 +155,7 @@ class NavercertService < BarocertService
155
155
  raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
156
156
  end
157
157
 
158
- httppost("/NAVER/Identity/#{clientCode}/#{receiptID}")
158
+ httppost("/NAVER/Identity/Verify/#{clientCode}/#{receiptID}")
159
159
  end
160
160
 
161
161
  def requestSign(clientCode, sign)
@@ -250,7 +250,7 @@ class NavercertService < BarocertService
250
250
  raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
251
251
  end
252
252
 
253
- httppost("/NAVER/Sign/#{clientCode}/#{receiptID}")
253
+ httppost("/NAVER/Sign/Verify/#{clientCode}/#{receiptID}")
254
254
  end
255
255
 
256
256
  def requestMultiSign(clientCode, multiSign)
@@ -346,7 +346,7 @@ class NavercertService < BarocertService
346
346
  raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
347
347
  end
348
348
 
349
- httppost("/NAVER/MultiSign/#{clientCode}/#{receiptID}")
349
+ httppost("/NAVER/MultiSign/Verify/#{clientCode}/#{receiptID}")
350
350
  end
351
351
 
352
352
  def requestCMS(clientCode, cms)
@@ -440,7 +440,7 @@ class NavercertService < BarocertService
440
440
  raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
441
441
  end
442
442
 
443
- httppost("/NAVER/CMS/#{clientCode}/#{receiptID}")
443
+ httppost("/NAVER/CMS/Verify/#{clientCode}/#{receiptID}")
444
444
  end
445
445
  end
446
446
 
@@ -160,7 +160,7 @@ class PasscertService < BarocertService
160
160
  raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
161
161
  end
162
162
 
163
- httppost("/PASS/Identity/#{clientCode}/#{receiptID}", identityVerify.to_json)
163
+ httppost("/PASS/Identity/Verify/#{clientCode}/#{receiptID}", identityVerify.to_json)
164
164
  end
165
165
 
166
166
  def requestSign(clientCode, sign)
@@ -252,7 +252,7 @@ class PasscertService < BarocertService
252
252
  raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
253
253
  end
254
254
 
255
- httppost("/PASS/Sign/#{clientCode}/#{receiptID}", signVerify.to_json)
255
+ httppost("/PASS/Sign/Verify/#{clientCode}/#{receiptID}", signVerify.to_json)
256
256
  end
257
257
 
258
258
  def requestCMS(clientCode, cms)
@@ -350,7 +350,7 @@ class PasscertService < BarocertService
350
350
  raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
351
351
  end
352
352
 
353
- httppost("/PASS/CMS/#{clientCode}/#{receiptID}", cmsVerify.to_json)
353
+ httppost("/PASS/CMS/Verify/#{clientCode}/#{receiptID}", cmsVerify.to_json)
354
354
  end
355
355
 
356
356
  def requestLogin(clientCode, login)
@@ -442,7 +442,7 @@ class PasscertService < BarocertService
442
442
  raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
443
443
  end
444
444
 
445
- httppost("/PASS/Login/#{clientCode}/#{receiptID}", loginVerify.to_json)
445
+ httppost("/PASS/Login/Verify/#{clientCode}/#{receiptID}", loginVerify.to_json)
446
446
  end
447
447
  end
448
448
 
@@ -0,0 +1,502 @@
1
+ # -*- coding: utf-8 -*-
2
+ require_relative '../barocert.rb'
3
+ require 'digest'
4
+ require 'openssl'
5
+ require 'base64'
6
+
7
+ # tosscert API BaseService class
8
+ class TosscertService < BarocertService
9
+ # Generate Linkhub Class Singleton Instance
10
+ class << self
11
+ def instance(linkID, secretKey)
12
+ super(linkID, secretKey)
13
+ @instance ||= new
14
+ @instance.addScope("461")
15
+ @instance.addScope("462")
16
+ @instance.addScope("463")
17
+ @instance.addScope("464")
18
+ @instance.addScope("465")
19
+ return @instance
20
+ end
21
+ private :new
22
+ end
23
+
24
+ def _sha256_base64url(target)
25
+ return self.sha256Base64urlFile(target)
26
+ end
27
+
28
+ def _sha256_base64url_file(target)
29
+ return self.sha256Base64urlFile(target)
30
+ end
31
+
32
+ def _encrypt(plaintext)
33
+ return aes256gcm(plaintext, @linkhub._secretKey)
34
+ end
35
+
36
+ def aes256gcm(plaintext, key)
37
+ iv = OpenSSL::Random.random_bytes(12)
38
+ cipher = OpenSSL::Cipher.new('aes-256-gcm')
39
+ cipher.encrypt
40
+ cipher.key = Base64.decode64(key)
41
+ cipher.iv = iv
42
+ ciphertext = cipher.update(plaintext) + cipher.final
43
+ return Base64.strict_encode64(iv + ciphertext + cipher.auth_tag)
44
+ end
45
+
46
+ def isNumber(str)
47
+ return str.is_i?
48
+ end
49
+
50
+ def isNullorEmptyTokenType(tokens)
51
+ if tokens.nil?
52
+ return true
53
+ end
54
+ tokens.each{ |token|
55
+ if token.nil?
56
+ return true
57
+ end
58
+ if token["tokenType"].to_s == ''
59
+ return true
60
+ end
61
+ }
62
+ false
63
+ end
64
+
65
+ def isNullorEmptyToken(tokens)
66
+ if tokens.nil?
67
+ return true
68
+ end
69
+ tokens.each{ |token|
70
+ if token.nil?
71
+ return true
72
+ end
73
+ if token["token"].to_s == ''
74
+ return true
75
+ end
76
+ }
77
+ false
78
+ end
79
+
80
+ def requestUserIdentity(clientCode, identity)
81
+
82
+ if clientCode.to_s == ''
83
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
84
+ end
85
+ if clientCode.is_i? == false
86
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
87
+ end
88
+ if clientCode.length != 12
89
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
90
+ end
91
+ if identity.nil?
92
+ raise BarocertException.new('-99999999', '본인확인 서명요청 정보가 입력되지 않았습니다.')
93
+ end
94
+ if identity["receiverHP"].to_s == ''
95
+ raise BarocertException.new('-99999999', '수신자 휴대폰번호가 입력되지 않았습니다.')
96
+ end
97
+ if identity["receiverName"].to_s == ''
98
+ raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
99
+ end
100
+ if identity["receiverBirthday"].to_s == ''
101
+ raise BarocertException.new('-99999999', '생년월일이 입력되지 않았습니다.')
102
+ end
103
+ if identity["expireIn"].to_s == ''
104
+ raise BarocertException.new('-99999999', '만료시간이 입력되지 않았습니다.')
105
+ end
106
+
107
+ httppost("/TOSS/UserIdentity/#{clientCode}", identity.to_json)
108
+ end
109
+
110
+ def getUserIdentityStatus(clientCode, receiptID)
111
+ puts receiptID
112
+ if clientCode.to_s == ''
113
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
114
+ end
115
+ if clientCode.is_i? == false
116
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
117
+ end
118
+ if clientCode.length != 12
119
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
120
+ end
121
+ if receiptID.to_s == ''
122
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
123
+ end
124
+ if receiptID.is_i? == false
125
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
126
+ end
127
+ if receiptID.length != 32
128
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
129
+ end
130
+
131
+ httpget("/TOSS/UserIdentity/#{clientCode}/#{receiptID}")
132
+ end
133
+
134
+ def verifyUserIdentity(clientCode, receiptID)
135
+ if clientCode.to_s == ''
136
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
137
+ end
138
+ if clientCode.is_i? == false
139
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
140
+ end
141
+ if clientCode.length != 12
142
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
143
+ end
144
+ if receiptID.to_s == ''
145
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
146
+ end
147
+ if receiptID.is_i? == false
148
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
149
+ end
150
+ if receiptID.length != 32
151
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
152
+ end
153
+
154
+ httppost("/TOSS/UserIdentity/Verify/#{clientCode}/#{receiptID}")
155
+ end
156
+
157
+ def requestIdentity(clientCode, identity)
158
+
159
+ if clientCode.to_s == ''
160
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
161
+ end
162
+ if clientCode.is_i? == false
163
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
164
+ end
165
+ if clientCode.length != 12
166
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
167
+ end
168
+ if identity.nil?
169
+ raise BarocertException.new('-99999999', '본인인증 서명요청 정보가 입력되지 않았습니다.')
170
+ end
171
+ if identity["receiverHP"].to_s == ''
172
+ raise BarocertException.new('-99999999', '수신자 휴대폰번호가 입력되지 않았습니다.')
173
+ end
174
+ if identity["receiverName"].to_s == ''
175
+ raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
176
+ end
177
+ if identity["receiverBirthday"].to_s == ''
178
+ raise BarocertException.new('-99999999', '생년월일이 입력되지 않았습니다.')
179
+ end
180
+
181
+ if identity["expireIn"].to_s == ''
182
+ raise BarocertException.new('-99999999', '만료시간이 입력되지 않았습니다.')
183
+ end
184
+
185
+ httppost("/TOSS/Identity/#{clientCode}", identity.to_json)
186
+ end
187
+
188
+ def getIdentityStatus(clientCode, receiptID)
189
+ puts receiptID
190
+ if clientCode.to_s == ''
191
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
192
+ end
193
+ if clientCode.is_i? == false
194
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
195
+ end
196
+ if clientCode.length != 12
197
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
198
+ end
199
+ if receiptID.to_s == ''
200
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
201
+ end
202
+ if receiptID.is_i? == false
203
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
204
+ end
205
+ if receiptID.length != 32
206
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
207
+ end
208
+
209
+ httpget("/TOSS/Identity/#{clientCode}/#{receiptID}")
210
+ end
211
+
212
+ def verifyIdentity(clientCode, receiptID)
213
+ if clientCode.to_s == ''
214
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
215
+ end
216
+ if clientCode.is_i? == false
217
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
218
+ end
219
+ if clientCode.length != 12
220
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
221
+ end
222
+ if receiptID.to_s == ''
223
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
224
+ end
225
+ if receiptID.is_i? == false
226
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
227
+ end
228
+ if receiptID.length != 32
229
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
230
+ end
231
+
232
+ httppost("/TOSS/Identity/Verify/#{clientCode}/#{receiptID}")
233
+ end
234
+
235
+ def requestSign(clientCode, sign)
236
+ if clientCode.to_s == ''
237
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
238
+ end
239
+ if clientCode.is_i? == false
240
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
241
+ end
242
+ if clientCode.length != 12
243
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
244
+ end
245
+ if sign.nil?
246
+ raise BarocertException.new('-99999999', '전자서명 서명요청 정보가 입력되지 않았습니다.')
247
+ end
248
+ if sign["receiverHP"].to_s == ''
249
+ raise BarocertException.new('-99999999', '수신자 휴대폰번호가 입력되지 않았습니다.')
250
+ end
251
+ if sign["receiverName"].to_s == ''
252
+ raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
253
+ end
254
+ if sign["receiverBirthday"].to_s == ''
255
+ raise BarocertException.new('-99999999', '생년월일이 입력되지 않았습니다.')
256
+ end
257
+
258
+ if sign["reqTitle"].to_s == ''
259
+ raise BarocertException.new('-99999999', '인증요청 메시지 제목이 입력되지 않았습니다.')
260
+ end
261
+
262
+ if sign["expireIn"].to_s == ''
263
+ raise BarocertException.new('-99999999', '만료시간이 입력되지 않았습니다.')
264
+ end
265
+
266
+ if sign["token"].to_s == ''
267
+ raise BarocertException.new('-99999999', '토큰 원문이 입력되지 않았습니다.')
268
+ end
269
+
270
+ if sign["tokenType"].to_s == ''
271
+ raise BarocertException.new('-99999999', '원문 유형이 입력되지 않았습니다.')
272
+ end
273
+ httppost("/TOSS/Sign/#{clientCode}", sign.to_json)
274
+ end
275
+
276
+ def getSignStatus(clientCode, receiptID)
277
+ if clientCode.to_s == ''
278
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
279
+ end
280
+ if clientCode.is_i? == false
281
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
282
+ end
283
+ if clientCode.length != 12
284
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
285
+ end
286
+ if receiptID.to_s == ''
287
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
288
+ end
289
+ if receiptID.is_i? == false
290
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
291
+ end
292
+ if receiptID.length != 32
293
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
294
+ end
295
+
296
+ httpget("/TOSS/Sign/#{clientCode}/#{receiptID}")
297
+ end
298
+
299
+ def verifySign(clientCode, receiptID)
300
+ if clientCode.to_s == ''
301
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
302
+ end
303
+ if clientCode.is_i? == false
304
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
305
+ end
306
+ if clientCode.length != 12
307
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
308
+ end
309
+ if receiptID.to_s == ''
310
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
311
+ end
312
+ if receiptID.is_i? == false
313
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
314
+ end
315
+ if receiptID.length != 32
316
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
317
+ end
318
+
319
+ httppost("/TOSS/Sign/Verify/#{clientCode}/#{receiptID}")
320
+ end
321
+
322
+ def requestMultiSign(clientCode, multiSign)
323
+ if clientCode.to_s == ''
324
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
325
+ end
326
+ if clientCode.is_i? == false
327
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
328
+ end
329
+ if clientCode.length != 12
330
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
331
+ end
332
+ if multiSign.nil?
333
+ raise BarocertException.new('-99999999', '전자서명 요청정보가 입력되지 않았습니다.')
334
+ end
335
+ if multiSign["receiverHP"].to_s == ''
336
+ raise BarocertException.new('-99999999', '수신자 휴대폰번호가 입력되지 않았습니다.')
337
+ end
338
+ if multiSign["receiverName"].to_s == ''
339
+ raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
340
+ end
341
+ if multiSign["receiverBirthday"].to_s == ''
342
+ raise BarocertException.new('-99999999', '생년월일이 입력되지 않았습니다.')
343
+ end
344
+
345
+ if multiSign["expireIn"].to_s == ''
346
+ raise BarocertException.new('-99999999', '만료시간이 입력되지 않았습니다.')
347
+ end
348
+
349
+ if isNullorEmptyToken(multiSign["tokens"])
350
+ raise BarocertException.new('-99999999', '토큰 원문이 입력되지 않았습니다.')
351
+ end
352
+
353
+ if isNullorEmptyTokenType(multiSign["tokens"])
354
+ raise BarocertException.new('-99999999', '원문 유형이 입력되지 않았습니다.')
355
+ end
356
+
357
+ httppost("/TOSS/MultiSign/#{clientCode}", multiSign.to_json)
358
+ end
359
+
360
+ def getMultiSignStatus(clientCode, receiptID)
361
+ if clientCode.to_s == ''
362
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
363
+ end
364
+ if clientCode.is_i? == false
365
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
366
+ end
367
+ if clientCode.length != 12
368
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
369
+ end
370
+ if receiptID.to_s == ''
371
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
372
+ end
373
+ if receiptID.is_i? == false
374
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
375
+ end
376
+ if receiptID.length != 32
377
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
378
+ end
379
+
380
+ httpget("/TOSS/MultiSign/#{clientCode}/#{receiptID}")
381
+ end
382
+
383
+ def verifyMultiSign(clientCode, receiptID)
384
+ if clientCode.to_s == ''
385
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
386
+ end
387
+ if clientCode.is_i? == false
388
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
389
+ end
390
+ if clientCode.length != 12
391
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
392
+ end
393
+ if receiptID.to_s == ''
394
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
395
+ end
396
+ if receiptID.is_i? == false
397
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
398
+ end
399
+ if receiptID.length != 32
400
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
401
+ end
402
+
403
+ httppost("/TOSS/MultiSign/Verify/#{clientCode}/#{receiptID}")
404
+ end
405
+
406
+ def requestCMS(clientCode, cms)
407
+
408
+ if clientCode.to_s == ''
409
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
410
+ end
411
+ if clientCode.is_i? == false
412
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
413
+ end
414
+ if clientCode.length != 12
415
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
416
+ end
417
+ if cms.nil?
418
+ raise BarocertException.new('-99999999', '본인인증 서명요청 정보가 입력되지 않았습니다.')
419
+ end
420
+ if cms["receiverHP"].to_s == ''
421
+ raise BarocertException.new('-99999999', '수신자 휴대폰번호가 입력되지 않았습니다.')
422
+ end
423
+ if cms["receiverName"].to_s == ''
424
+ raise BarocertException.new('-99999999', '수신자 성명이 입력되지 않았습니다.')
425
+ end
426
+ if cms["receiverBirthday"].to_s == ''
427
+ raise BarocertException.new('-99999999', '생년월일이 입력되지 않았습니다.')
428
+ end
429
+ if cms["expireIn"].to_s == ''
430
+ raise BarocertException.new('-99999999', '만료시간이 입력되지 않았습니다.')
431
+ end
432
+ if cms["requestCorp"].to_s == ''
433
+ raise BarocertException.new('-99999999', '청구기관명이 입력되지 않았습니다.')
434
+ end
435
+ if cms["bankName"].to_s == ''
436
+ raise BarocertException.new('-99999999', '은행명이 입력되지 않았습니다.')
437
+ end
438
+ if cms["bankAccountNum"].to_s == ''
439
+ raise BarocertException.new('-99999999', '계좌번호가 입력되지 않았습니다.')
440
+ end
441
+ if cms["bankAccountName"].to_s == ''
442
+ raise BarocertException.new('-99999999', '예금주명이 입력되지 않았습니다.')
443
+ end
444
+ if cms["bankAccountBirthday"].to_s == ''
445
+ raise BarocertException.new('-99999999', '예금주 생년월일이 입력되지 않았습니다.')
446
+ end
447
+ httppost("/TOSS/CMS/#{clientCode}", cms.to_json)
448
+ end
449
+
450
+ def getCMSStatus(clientCode, receiptID)
451
+ puts receiptID
452
+ if clientCode.to_s == ''
453
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
454
+ end
455
+ if clientCode.is_i? == false
456
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
457
+ end
458
+ if clientCode.length != 12
459
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
460
+ end
461
+ if receiptID.to_s == ''
462
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
463
+ end
464
+ if receiptID.is_i? == false
465
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
466
+ end
467
+ if receiptID.length != 32
468
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
469
+ end
470
+
471
+ httpget("/TOSS/CMS/#{clientCode}/#{receiptID}")
472
+ end
473
+
474
+ def verifyCMS(clientCode, receiptID)
475
+ if clientCode.to_s == ''
476
+ raise BarocertException.new('-99999999', '이용기관코드가 입력되지 않았습니다.')
477
+ end
478
+ if clientCode.is_i? == false
479
+ raise BarocertException.new('-99999999', '이용기관코드는 숫자만 입력할 수 있습니다.')
480
+ end
481
+ if clientCode.length != 12
482
+ raise BarocertException.new('-99999999', '이용기관코드는 12자 입니다.')
483
+ end
484
+ if receiptID.to_s == ''
485
+ raise BarocertException.new('-99999999', '접수아이디가 입력되지 않았습니다.')
486
+ end
487
+ if receiptID.is_i? == false
488
+ raise BarocertException.new('-99999999', '접수아이디는 숫자만 입력할 수 있습니다.')
489
+ end
490
+ if receiptID.length != 32
491
+ raise BarocertException.new('-99999999', '접수아이디는 32자 입니다.')
492
+ end
493
+
494
+ httppost("/TOSS/CMS/Verify/#{clientCode}/#{receiptID}")
495
+ end
496
+ end
497
+
498
+ class String
499
+ def is_i?
500
+ !!(self =~ /^\d+$/)
501
+ end
502
+ end
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.3.1
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linkhub Dev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-30 00:00:00.000000000 Z
11
+ date: 2025-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: linkhub
@@ -34,11 +34,12 @@ files:
34
34
  - lib/barocert/kakaocert.rb
35
35
  - lib/barocert/navercert.rb
36
36
  - lib/barocert/passcert.rb
37
- homepage: https://github.com/barocert/barocert.ruby
37
+ - lib/barocert/tosscert.rb
38
+ homepage:
38
39
  licenses:
39
40
  - MIT
40
41
  metadata: {}
41
- post_install_message:
42
+ post_install_message:
42
43
  rdoc_options: []
43
44
  require_paths:
44
45
  - lib
@@ -53,8 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
54
  - !ruby/object:Gem::Version
54
55
  version: '0'
55
56
  requirements: []
56
- rubygems_version: 3.1.4
57
- signing_key:
57
+ rubygems_version: 3.0.3.1
58
+ signing_key:
58
59
  specification_version: 4
59
60
  summary: barocert API SDK
60
61
  test_files: []