Class: FaxService
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
#isTest, #linkhub, #scopes, #token_table
Class Method Summary
collapse
Instance Method Summary
collapse
-
#cancelReserve(corpNum, receiptNum, userID = '') ⇒ Object
-
#cancelReserveRN(corpNum, requestNum, userID = '') ⇒ Object
-
#getChargeInfo(corpNum, userID = '') ⇒ Object
-
#getFaxDetail(corpNum, receiptNum, userID = '') ⇒ Object
-
#getFaxDetailRN(corpNum, requestNum, userID = '') ⇒ Object
-
#getPreviewURL(corpNum, receiptNum, userID = '') ⇒ Object
-
#getSenderNumberList(corpNum, userID = '') ⇒ Object
-
#getSenderNumberMgtURL(corpNum, userID) ⇒ Object
-
#getSentListURL(corpNum, userID) ⇒ Object
-
#getUnitCost(corpNum, userID = '') ⇒ Object
-
#getURL(corpNum, togo, userID = '') ⇒ Object
-
#resendFax(corpNum, receiptNum, senderNum, senderName, receiveNum, receiveName, reserveDT = '', userID = '', title = '', requestNum = '') ⇒ Object
-
#resendFax_multi(corpNum, receiptNum, senderNum = '', senderName = '', receivers = nil, reserveDT = '', userID = '', title = '', requestNum = '') ⇒ Object
-
#resendFAXRN(corpNum, orgRequestNum, senderNum, senderName, receiveNum, receiveName, reserveDT = '', userID = '', title = '', requestNum = '') ⇒ Object
-
#resendFAXRN_multi(corpNum, orgRequestNum, senderNum = '', senderName = '', receivers = nil, reserveDT = '', userID = '', title = '', requestNum = '') ⇒ Object
-
#search(corpNum, sDate, eDate, state, reserveYN, senderOnly, page, perPage, order, userID = '', queryString = '') ⇒ Object
-
#sendFax(corpNum, senderNum, senderName, receiverNum, receiverName, filePath, reserveDT = '', userID = '', adsYN = false, title = '', requestNum = '') ⇒ Object
-
#sendFax_multi(corpNum, senderNum, senderName, receivers, filePaths, reserveDT = '', userID = '', adsYN = false, title = '', requestNum = '') ⇒ 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, #setIsTest, #updateContact, #updateCorpInfo
Class Method Details
.instance(linkID, secretKey) ⇒ Object
7
8
9
10
11
12
|
# File 'lib/popbill/fax.rb', line 7
def instance(linkID, secretKey)
super(linkID, secretKey)
@instance ||= new
@instance.addScope("160")
return @instance
end
|
Instance Method Details
#cancelReserve(corpNum, receiptNum, userID = '') ⇒ Object
219
220
221
222
223
224
225
226
227
228
|
# File 'lib/popbill/fax.rb', line 219
def cancelReserve(corpNum, receiptNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
if receiptNum.to_s == ''
raise PopbillException.new(-99999999, "접수번호(receiptNum)가 입력되지 않았습니다.")
end
httpget("/FAX/#{receiptNum}/Cancel", corpNum, userID)
end
|
#cancelReserveRN(corpNum, requestNum, userID = '') ⇒ Object
243
244
245
246
247
248
249
250
251
252
|
# File 'lib/popbill/fax.rb', line 243
def cancelReserveRN(corpNum, requestNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
if requestNum.to_s == ''
raise PopbillException.new(-99999999, "요청번호(requestNum)가 입력되지 않았습니다.")
end
httpget("/FAX/Cancel/#{requestNum}", corpNum, userID)
end
|
#getChargeInfo(corpNum, userID = '') ⇒ Object
17
18
19
20
21
22
|
# File 'lib/popbill/fax.rb', line 17
def getChargeInfo(corpNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
httpget("/FAX/ChargeInfo", corpNum, userID)
end
|
#getFaxDetail(corpNum, receiptNum, userID = '') ⇒ Object
208
209
210
211
212
213
214
215
216
217
|
# File 'lib/popbill/fax.rb', line 208
def getFaxDetail(corpNum, receiptNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
if receiptNum.to_s == ''
raise PopbillException.new(-99999999, "접수번호(receiptNum)가 입력되지 않았습니다.")
end
httpget("/FAX/#{receiptNum}", corpNum, userID)
end
|
#getFaxDetailRN(corpNum, requestNum, userID = '') ⇒ Object
231
232
233
234
235
236
237
238
239
240
|
# File 'lib/popbill/fax.rb', line 231
def getFaxDetailRN(corpNum, requestNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
if requestNum.to_s == ''
raise PopbillException.new(-99999999, "요청번호(requestNum)가 입력되지 않았습니다.")
end
httpget("/FAX/Get/#{requestNum}", corpNum, userID)
end
|
#getPreviewURL(corpNum, receiptNum, userID = '') ⇒ Object
254
255
256
257
258
259
260
261
262
263
|
# File 'lib/popbill/fax.rb', line 254
def getPreviewURL(corpNum, receiptNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
if receiptNum.to_s == ''
raise PopbillException.new(-99999999, "접수번호(receiptNum)가 입력되지 않았습니다.")
end
httpget("/FAX/Preview/#{receiptNum}", corpNum, userID)['url']
end
|
#getSenderNumberList(corpNum, userID = '') ⇒ Object
24
25
26
27
28
29
|
# File 'lib/popbill/fax.rb', line 24
def getSenderNumberList(corpNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
httpget("/FAX/SenderNumber", corpNum, userID)
end
|
#getSenderNumberMgtURL(corpNum, userID) ⇒ Object
49
50
51
52
53
54
55
56
|
# File 'lib/popbill/fax.rb', line 49
def getSenderNumberMgtURL(corpNum, userID)
if corpNum.length != 10
raise PopbillException.new(-99999999, '사업자등록번호가 올바르지 않습니다.')
end
response = httpget("/FAX/?TG=SENDER", corpNum, userID)
response['url']
end
|
#getSentListURL(corpNum, userID) ⇒ Object
39
40
41
42
43
44
45
46
|
# File 'lib/popbill/fax.rb', line 39
def getSentListURL(corpNum, userID)
if corpNum.length != 10
raise PopbillException.new(-99999999, '사업자등록번호가 올바르지 않습니다.')
end
response = httpget("/FAX/?TG=BOX", corpNum, userID)
response['url']
end
|
#getUnitCost(corpNum, userID = '') ⇒ Object
58
59
60
61
62
63
|
# File 'lib/popbill/fax.rb', line 58
def getUnitCost(corpNum, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
httpget("/FAX/UnitCost", corpNum, userID)['unitCost']
end
|
#getURL(corpNum, togo, userID = '') ⇒ Object
31
32
33
34
35
36
|
# File 'lib/popbill/fax.rb', line 31
def getURL(corpNum, togo, userID = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
httpget("/FAX/?TG=#{togo}", corpNum, userID)['url']
end
|
#resendFax(corpNum, receiptNum, senderNum, senderName, receiveNum, receiveName, reserveDT = '', userID = '', title = '', requestNum = '') ⇒ Object
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
# File 'lib/popbill/fax.rb', line 131
def resendFax(corpNum, receiptNum, senderNum, senderName, receiveNum, receiveName,
reserveDT = '', userID = '', title = '', requestNum = '')
if receiptNum.to_s == ''
raise PopbillException.new('-99999999', '팩스접수번호(receiptNum)가 입력되지 않았습니다.')
end
receiver = nil
if receiveNum.to_s != '' || receiveName.to_s != ''
receiver = [
{
"rcv" => receiveNum,
"rcvnm" => receiveName,
}
]
end
resendFax_multi(corpNum, receiptNum, senderNum, senderName, receiver, reserveDT, userID, title, requestNum)
end
|
#resendFax_multi(corpNum, receiptNum, senderNum = '', senderName = '', receivers = nil, reserveDT = '', userID = '', title = '', requestNum = '') ⇒ Object
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
# File 'lib/popbill/fax.rb', line 150
def resendFax_multi(corpNum, receiptNum, senderNum = '', senderName = '', receivers = nil,
reserveDT = '', userID = '', title = '', requestNum = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
postData = {}
postData["snd"] = senderNum
postData["sndnm"] = senderName
postData["sndDT"] = reserveDT
postData["rcvs"] = receivers
postData["title"] = title
postData["requestNum"] = requestNum
postData = postData.to_json
httppost("/FAX/#{receiptNum}", corpNum, postData, "", userID)['receiptNum']
end
|
#resendFAXRN(corpNum, orgRequestNum, senderNum, senderName, receiveNum, receiveName, reserveDT = '', userID = '', title = '', requestNum = '') ⇒ Object
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
# File 'lib/popbill/fax.rb', line 169
def resendFAXRN(corpNum, orgRequestNum, senderNum, senderName, receiveNum, receiveName,
reserveDT = '', userID = '', title = '', requestNum = '')
receiver = nil
if receiveNum.to_s != '' || receiveName.to_s != ''
receiver = [
{
"rcv" => receiveNum,
"rcvnm" => receiveName,
}
]
end
resendFAXRN_multi(corpNum, orgRequestNum, senderNum, senderName, receiver, reserveDT, userID, title, requestNum)
end
|
#resendFAXRN_multi(corpNum, orgRequestNum, senderNum = '', senderName = '', receivers = nil, reserveDT = '', userID = '', title = '', requestNum = '') ⇒ Object
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
# File 'lib/popbill/fax.rb', line 186
def resendFAXRN_multi(corpNum, orgRequestNum, senderNum = '', senderName = '', receivers = nil,
reserveDT = '', userID = '', title = '', requestNum = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
if orgRequestNum.to_s == ''
raise PopbillException.new(-99999999, "원본 팩스 요청번호가 입력되지 않았습니다.")
end
postData = {}
postData["snd"] = senderNum
postData["sndnm"] = senderName
postData["sndDT"] = reserveDT
postData["rcvs"] = receivers
postData["title"] = title
postData["requestNum"] = requestNum
postData = postData.to_json
httppost("/FAX/Resend/#{orgRequestNum}", corpNum, postData, "", userID)['receiptNum']
end
|
#search(corpNum, sDate, eDate, state, reserveYN, senderOnly, page, perPage, order, userID = '', queryString = '') ⇒ Object
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/popbill/fax.rb', line 65
def search(corpNum, sDate, eDate, state, reserveYN, senderOnly, page, perPage,
order, userID = '', queryString = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, '사업자등록번호가 올바르지 않습니다.')
end
if sDate.to_s == ''
raise PopbillException.new(-99999999, '시작일자가 입력되지 않았습니다.')
end
if eDate.to_s == ''
raise PopbillException.new(-99999999, '종료일자가 입력되지 않았습니다.')
end
uri = "/FAX/Search?SDate=#{sDate}&EDate=#{eDate}"
uri += "&State=" + state.join(',') if state.to_s != ''
uri += "&ReserveYN=" + reserveYN
uri += "&SenderOnly=" + senderOnly
uri += "&Page=" + page.to_s
uri += "&PerPage=" + perPage.to_s
uri += "&Order=" + order
if queryString.to_s != ''
uri += "&QString=" + queryString
end
httpget(URI.escape(uri), corpNum, userID)
end
|
#sendFax(corpNum, senderNum, senderName, receiverNum, receiverName, filePath, reserveDT = '', userID = '', adsYN = false, title = '', requestNum = '') ⇒ Object
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# File 'lib/popbill/fax.rb', line 93
def sendFax(corpNum, senderNum, senderName, receiverNum, receiverName, filePath,
reserveDT = '', userID = '', adsYN = false, title = '', requestNum = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
receiver = [
{
"rcv" => receiverNum,
"rcvnm" => receiverName,
}
]
sendFax_multi(corpNum, senderNum, senderName, receiver, filePath, reserveDT, userID, adsYN, title, requestNum)
end
|
#sendFax_multi(corpNum, senderNum, senderName, receivers, filePaths, reserveDT = '', userID = '', adsYN = false, title = '', requestNum = '') ⇒ Object
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
# File 'lib/popbill/fax.rb', line 109
def sendFax_multi(corpNum, senderNum, senderName, receivers, filePaths,
reserveDT = '', userID = '', adsYN = false, title = '', requestNum = '')
if corpNum.length != 10
raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
end
postData = {}
postData["snd"] = senderNum
postData["sndnm"] = senderName
postData["fCnt"] = filePaths.length
postData["sndDT"] = reserveDT
postData["rcvs"] = receivers
postData["title"] = title
postData["requestNum"] = requestNum
if adsYN
postData["adsYN"] = adsYN
end
httppostfile("/FAX", corpNum, postData, filePaths, userID)['receiptNum']
end
|