Class: StatementService
Overview
팝빌 전자명세서 API Service Implementation
Constant Summary
Constants inherited
from BaseService
BaseService::BOUNDARY, BaseService::POPBILL_APIVersion, BaseService::ServiceID_REAL, BaseService::ServiceID_TEST, BaseService::ServiceURL_REAL, BaseService::ServiceURL_TEST
Instance Attribute Summary
Attributes inherited from BaseService
#ipRestrictOnOff, #isTest, #linkhub, #scopes, #token_table
Class Method Summary
collapse
Instance Method Summary
collapse
-
#attachFile(corpNum, itemCode, mgtKey, filePath, userID = '') ⇒ Object
-
#attachStatement(corpNum, itemCode, mgtKey, subItemCode, subMgtKey, userID = '') ⇒ Object
-
#cancel(corpNum, itemCode, mgtKey, memo = '', userID = '') ⇒ Object
-
#checkMgtKeyInUse(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#delete(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#deleteFile(corpNum, itemCode, mgtKey, fileID, userID = '') ⇒ Object
-
#detachStatement(corpNum, itemCode, mgtKey, subItemCode, subMgtKey, userID = '') ⇒ Object
-
#faxSend(corpNum, statement, sendNum, receiveNum, userID = '') ⇒ Object
-
#getChargeInfo(corpNum, itemCode, userID = '') ⇒ Object
-
#getDetailInfo(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#getEPrintURL(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#getFiles(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#getInfo(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#getInfos(corpNum, itemCode, mgtKeyList, userID = '') ⇒ Object
-
#getLogs(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#getMailURL(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#getMassPrintURL(corpNum, itemCode, mgtKeyList, userID = '') ⇒ Object
-
#getPopUpURL(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#getPrintURL(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
-
#getUnitCost(corpNum, itemCode, userID = '') ⇒ Object
-
#getURL(corpNum, togo, userID = '') ⇒ Object
-
#issue(corpNum, itemCode, mgtKey, memo = '', emailSubject = '', userID = '') ⇒ Object
-
#listEmailConfig(corpNum, userID = '') ⇒ Object
-
#register(corpNum, statement, userID = '') ⇒ Object
-
#registIssue(corpNum, statement, memo = '', userID = '', emailSubject = '') ⇒ Object
-
#search(corpNum, dType, sDate, eDate, state, itemCode, page, perPage, order, qstring = '', userID = '') ⇒ Object
-
#sendEmail(corpNum, itemCode, mgtKey, receiverMail, userID = '') ⇒ Object
-
#sendFax(corpNum, itemCode, mgtKey, senderNum, receiverNum, userID = '') ⇒ Object
-
#sendSMS(corpNum, itemCode, mgtKey, senderNum, receiverNum, contents, userID = '') ⇒ Object
-
#update(corpNum, itemCode, mgtKey, statement, userID = '') ⇒ Object
-
#updateEmailConfig(corpNum, emailType, sendYN, userID = '') ⇒ Object
Methods inherited from BaseService
#addScope, #checkID, #checkIsMember, #getAccessURL, #getBalance, #getChargeURL, #getCorpInfo, #getPartnerBalance, #getPartnerURL, #getPopbillURL, #getServiceID, #getServiceURL, #getSession_Token, #gzip_parse, #httpget, #httppost, #httppostfile, #httppostfiles, #joinMember, #listContact, #registContact, #setIpRestrictOnOff, #setIsTest, #updateContact, #updateCorpInfo
Class Method Details
.instance(linkID, secretKey) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/popbill/statement.rb', line 7
def instance(linkID, secretKey)
super(linkID, secretKey)
@instance ||= new
@instance.addScope("121")
@instance.addScope("122")
@instance.addScope("123")
@instance.addScope("124")
@instance.addScope("125")
@instance.addScope("126")
return @instance
end
|
Instance Method Details
#attachFile(corpNum, itemCode, mgtKey, filePath, userID = '') ⇒ Object
304
305
306
307
308
309
310
311
312
313
|
# File 'lib/popbill/statement.rb', line 304
def attachFile(corpNum, itemCode, mgtKey, filePath, userID ='')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httppostfiles("/Statement/#{itemCode}/#{mgtKey}/Files", corpNum, '', [filePath], userID)
end
|
#attachStatement(corpNum, itemCode, mgtKey, subItemCode, subMgtKey, userID = '') ⇒ Object
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
|
# File 'lib/popbill/statement.rb', line 400
def attachStatement(corpNum, itemCode, mgtKey, subItemCode, subMgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호가 입력되지 않았습니다.')
end
if itemCode.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
end
if subItemCode.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
end
if subMgtKey.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 문서관리번호가 입력되지 않았습니다.')
end
postData = {}
postData["ItemCode"] = subItemCode
postData["MgtKey"] = subMgtKey
postData = postData.to_json
httppost("/Statement/#{itemCode}/#{mgtKey}/AttachStmt", corpNum, postData, "", userID)
end
|
#cancel(corpNum, itemCode, mgtKey, memo = '', userID = '') ⇒ Object
131
132
133
134
135
136
137
138
139
140
|
# File 'lib/popbill/statement.rb', line 131
def cancel(corpNum, itemCode, mgtKey, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
postData = {}
postData["memo"] = memo
postData = postData.to_json
httppost("/Statement/#{itemCode}/#{mgtKey}", corpNum, postData, "CANCEL", userID)
end
|
#checkMgtKeyInUse(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/popbill/statement.rb', line 42
def checkMgtKeyInUse(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
if mgtKey.to_s == ''
raise PopbillException.new(-99999999, "현금영수증 문서관리번호가 입력되지 않았습니다.")
end
begin
response = httpget("/Statement/#{itemCode}/#{mgtKey}", corpNum)
return response['itemKey'].length != 0
rescue PopbillException => pe
if pe.code == -12000004
return false
end
raise PopbillException.new(pe.code, pe.message)
end
end
|
#delete(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
143
144
145
146
147
148
149
|
# File 'lib/popbill/statement.rb', line 143
def delete(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
httppost("/Statement/#{itemCode}/#{mgtKey}", corpNum, "", "DELETE", userID)
end
|
#deleteFile(corpNum, itemCode, mgtKey, fileID, userID = '') ⇒ Object
327
328
329
330
331
332
333
334
335
336
337
338
339
|
# File 'lib/popbill/statement.rb', line 327
def deleteFile(corpNum, itemCode, mgtKey, fileID, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
if fileID.to_s == ''
raise PopbillException.new('-99999999', '파일아이디가 입력되지 않았습니다.')
end
httppost("/Statement/#{itemCode}/#{mgtKey}/Files/#{fileID}", corpNum, '', "DELETE", userID)
end
|
#detachStatement(corpNum, itemCode, mgtKey, subItemCode, subMgtKey, userID = '') ⇒ Object
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
|
# File 'lib/popbill/statement.rb', line 425
def detachStatement(corpNum, itemCode, mgtKey, subItemCode, subMgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호가 입력되지 않았습니다.')
end
if itemCode.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
end
if subItemCode.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
end
if subMgtKey.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 문서관리번호가 입력되지 않았습니다.')
end
postData = {}
postData["ItemCode"] = subItemCode
postData["MgtKey"] = subMgtKey
postData = postData.to_json
httppost("/Statement/#{itemCode}/#{mgtKey}/DetachStmt", corpNum, postData, "", userID)
end
|
#faxSend(corpNum, statement, sendNum, receiveNum, userID = '') ⇒ Object
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/popbill/statement.rb', line 61
def faxSend(corpNum, statement, sendNum, receiveNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
if sendNum.to_s == ''
raise PopbillException.new(-99999999, "팩스 발신번호가 입력되지 않았습니다.")
end
if receiveNum.to_s == ''
raise PopbillException.new(-99999999, "팩스 수신번호가 입력되지 않았습니다.")
end
statement["sendNum"] = sendNum
statement["receiveNum"] = receiveNum
postData = statement.to_json
httppost("/Statement", corpNum, postData, "FAX", userID)['receiptNum']
end
|
#getChargeInfo(corpNum, itemCode, userID = '') ⇒ Object
21
22
23
24
25
26
|
# File 'lib/popbill/statement.rb', line 21
def getChargeInfo(corpNum, itemCode, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
httpget("/Statement/ChargeInfo/#{itemCode}", corpNum, userID)
end
|
#getDetailInfo(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
208
209
210
211
212
213
214
215
216
217
|
# File 'lib/popbill/statement.rb', line 208
def getDetailInfo(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Statement/#{itemCode}/#{mgtKey}?Detail", corpNum, userID)
end
|
#getEPrintURL(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
364
365
366
367
368
369
370
371
372
373
|
# File 'lib/popbill/statement.rb', line 364
def getEPrintURL(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=EPRINT", corpNum, userID)['url']
end
|
#getFiles(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
315
316
317
318
319
320
321
322
323
324
|
# File 'lib/popbill/statement.rb', line 315
def getFiles(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Statement/#{itemCode}/#{mgtKey}/Files", corpNum)
end
|
#getInfo(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
182
183
184
185
186
187
188
189
190
191
|
# File 'lib/popbill/statement.rb', line 182
def getInfo(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 입력되지 않았습니다.')
end
httpget("/Statement/#{itemCode}/#{mgtKey}", corpNum, userID)
end
|
#getInfos(corpNum, itemCode, mgtKeyList, userID = '') ⇒ Object
194
195
196
197
198
199
200
201
202
203
204
205
|
# File 'lib/popbill/statement.rb', line 194
def getInfos(corpNum, itemCode, mgtKeyList, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
unless mgtKeyList.any?
raise PopbillException.new('-99999999', '문서관리번호 배열이 올바르지 않습니다.')
end
postData = mgtKeyList.to_json
httppost("/Statement/#{itemCode}", corpNum, postData, "", userID)
end
|
#getLogs(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
293
294
295
296
297
298
299
300
301
302
|
# File 'lib/popbill/statement.rb', line 293
def getLogs(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Statement/#{itemCode}/#{mgtKey}/Logs", corpNum, userID)
end
|
#getMailURL(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
375
376
377
378
379
380
381
382
383
384
|
# File 'lib/popbill/statement.rb', line 375
def getMailURL(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=MAIL", corpNum, userID)['url']
end
|
#getMassPrintURL(corpNum, itemCode, mgtKeyList, userID = '') ⇒ Object
387
388
389
390
391
392
393
394
395
396
397
|
# File 'lib/popbill/statement.rb', line 387
def getMassPrintURL(corpNum, itemCode, mgtKeyList, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
unless mgtKeyList.any?
raise PopbillException.new('-99999999', '문서관리번호 배열이 올바르지 않습니다.')
end
postData = mgtKeyList.to_json
httppost("/Statement/#{itemCode}?Print", corpNum, postData, "", userID)['url']
end
|
341
342
343
344
345
346
347
348
349
350
|
# File 'lib/popbill/statement.rb', line 341
def (corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=POPUP", corpNum, userID)['url']
end
|
#getPrintURL(corpNum, itemCode, mgtKey, userID = '') ⇒ Object
353
354
355
356
357
358
359
360
361
362
|
# File 'lib/popbill/statement.rb', line 353
def getPrintURL(corpNum, itemCode, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Statement/#{itemCode}/#{mgtKey}?TG=PRINT", corpNum, userID)['url']
end
|
#getUnitCost(corpNum, itemCode, userID = '') ⇒ Object
35
36
37
38
39
40
|
# File 'lib/popbill/statement.rb', line 35
def getUnitCost(corpNum, itemCode, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
httpget("/Statement/#{itemCode}?cfg=UNITCOST", corpNum, userID)['unitCost']
end
|
#getURL(corpNum, togo, userID = '') ⇒ Object
28
29
30
31
32
33
|
# File 'lib/popbill/statement.rb', line 28
def getURL(corpNum, togo, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
httpget("/Statement?TG=#{togo}", corpNum, userID)['url']
end
|
#issue(corpNum, itemCode, mgtKey, memo = '', emailSubject = '', userID = '') ⇒ Object
119
120
121
122
123
124
125
126
127
128
129
|
# File 'lib/popbill/statement.rb', line 119
def issue(corpNum, itemCode, mgtKey, memo ='', emailSubject = '', userID ='')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
postData = {}
postData["memo"] = memo
postData["emailSubject"] = emailSubject
postData = postData.to_json
httppost("/Statement/#{itemCode}/#{mgtKey}", corpNum, postData, "ISSUE", userID)
end
|
#listEmailConfig(corpNum, userID = '') ⇒ Object
450
451
452
453
454
455
456
|
# File 'lib/popbill/statement.rb', line 450
def listEmailConfig(corpNum, userID ='')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
httpget("/Statement/EmailSendConfig", corpNum, userID)
end
|
#register(corpNum, statement, userID = '') ⇒ Object
98
99
100
101
102
103
104
105
|
# File 'lib/popbill/statement.rb', line 98
def register(corpNum, statement, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
postData = statement.to_json
httppost("/Statement", corpNum, postData, "", userID)
end
|
#registIssue(corpNum, statement, memo = '', userID = '', emailSubject = '') ⇒ Object
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
# File 'lib/popbill/statement.rb', line 81
def registIssue(corpNum, statement, memo = '', userID ='', emailSubject = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
statement["memo"] = memo
if emailSubject.to_s != ''
statement["emailSubject"] = emailSubject
end
postData = statement.to_json
httppost("/Statement", corpNum, postData, "ISSUE", userID)
end
|
#search(corpNum, dType, sDate, eDate, state, itemCode, page, perPage, order, qstring = '', userID = '') ⇒ Object
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
# File 'lib/popbill/statement.rb', line 152
def search(corpNum, dType, sDate, eDate, state, itemCode, page, perPage, order,
qstring= '', userID ='')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if dType.to_s == ''
raise PopbillException.new('-99999999', '검색일자유형이 입력되지 않았습니다.')
end
if sDate.to_s == ''
raise PopbillException.new('-99999999', '시작일자가 입력되지 않았습니다.')
end
if eDate.to_s == ''
raise PopbillException.new('-99999999', '종료일자가 입력되지 않았습니다.')
end
uri = "/Statement/Search?DType=#{dType}&SDate=#{sDate}&EDate=#{eDate}"
uri += "&State=" + state.join(',')
uri += "&ItemCode=" + itemCode.join(',')
uri += "&Page=" + page.to_s
uri += "&PerPage=" + perPage.to_s
uri += "&Order=" + order
uri += "&QString=" + qstring
httpget(URI.escape(uri), corpNum, userID)
end
|
#sendEmail(corpNum, itemCode, mgtKey, receiverMail, userID = '') ⇒ Object
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
# File 'lib/popbill/statement.rb', line 219
def sendEmail(corpNum, itemCode, mgtKey, receiverMail, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
if receiverMail.to_s == ''
raise PopbillException.new('-99999999', '수신자 메일주소가 올바르지 않습니다.')
end
postData = {}
postData["receiver"] = receiverMail
postData = postData.to_json
httppost("/Statement/#{itemCode}/#{mgtKey}", corpNum, postData, "EMAIL", userID)
end
|
#sendFax(corpNum, itemCode, mgtKey, senderNum, receiverNum, userID = '') ⇒ Object
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
# File 'lib/popbill/statement.rb', line 269
def sendFax(corpNum, itemCode, mgtKey, senderNum, receiverNum, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
if senderNum.to_s == ''
raise PopbillException.new('-99999999', '발신번호가 입력되지 않았습니다.')
end
if receiverNum.to_s == ''
raise PopbillException.new('-99999999', '수신번호가 입력되지 않았습니다.')
end
postData = {}
postData["sender"] = senderNum
postData["receiver"] = receiverNum
postData = postData.to_json
httppost("/Statement/#{itemCode}/#{mgtKey}", corpNum, postData, "FAX", userID)
end
|
#sendSMS(corpNum, itemCode, mgtKey, senderNum, receiverNum, contents, userID = '') ⇒ Object
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
# File 'lib/popbill/statement.rb', line 238
def sendSMS(corpNum, itemCode, mgtKey, senderNum, receiverNum, contents, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
if senderNum.to_s == ''
raise PopbillException.new('-99999999', '발신번호가 입력되지 않았습니다.')
end
if receiverNum.to_s == ''
raise PopbillException.new('-99999999', '수신번호가 입력되지 않았습니다.')
end
if contents.to_s == ''
raise PopbillException.new('-99999999', '문자 메시지 내용이 입력되지 않았습니다.')
end
postData = {}
postData["sender"] = senderNum
postData["receiver"] = receiverNum
postData["contents"] = contents
postData = postData.to_json
httppost("/Statement/#{itemCode}/#{mgtKey}", corpNum, postData, "SMS", userID)
end
|
#update(corpNum, itemCode, mgtKey, statement, userID = '') ⇒ Object
108
109
110
111
112
113
114
115
116
|
# File 'lib/popbill/statement.rb', line 108
def update(corpNum, itemCode, mgtKey, statement, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
postData = statement.to_json
httppost("/Statement/#{itemCode}/#{mgtKey}", corpNum, postData, "PATCH", userID)
end
|
#updateEmailConfig(corpNum, emailType, sendYN, userID = '') ⇒ Object
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
# File 'lib/popbill/statement.rb', line 458
def updateEmailConfig(corpNum, emailType, sendYN, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if emailType.to_s == ''
raise PopbillException.new('-99999999', '메일전송 타입이 입력되지 않았습니다.')
end
if sendYN.to_s == ''
raise PopbillException.new('-99999999', '메일전송 여부 항목이 입력되지 않았습니다.')
end
httppost("/Statement/EmailSendConfig?EmailType=#{emailType}&SendYN=#{sendYN}", corpNum, userID)
end
|