class FaxService

팝빌 팩스 API Service Implementation

Public Class Methods

instance(linkID, secretKey) click to toggle source
Calls superclass method BaseService::instance
# File lib/popbill/fax.rb, line 6
def instance(linkID, secretKey)
  super(linkID, secretKey)
  @instance ||= new
  @instance.addScope("160")
  return @instance
end

Public Instance Methods

cancelReserve(corpNum, receiptNum, userID = '') click to toggle source
# File lib/popbill/fax.rb, line 218
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 = '') click to toggle source
# File lib/popbill/fax.rb, line 242
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 = '') click to toggle source
# File lib/popbill/fax.rb, line 16
def getChargeInfo(corpNum, userID = '')
  if corpNum.length != 10
    raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
  end
  httpget("/FAX/ChargeInfo", corpNum, userID)
end
getFaxDetail(corpNum, receiptNum, userID = '') click to toggle source
# File lib/popbill/fax.rb, line 207
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 = '') click to toggle source
# File lib/popbill/fax.rb, line 230
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 = '') click to toggle source
# File lib/popbill/fax.rb, line 253
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 = '') click to toggle source
# File lib/popbill/fax.rb, line 23
def getSenderNumberList(corpNum, userID = '')
  if corpNum.length != 10
    raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
  end
  httpget("/FAX/SenderNumber", corpNum, userID)
end
getSenderNumberMgtURL(corpNum, userID) click to toggle source

발신번호 관리 팝업 URL

# File lib/popbill/fax.rb, line 48
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) click to toggle source

팩스 전송내역 팝업 URL

# File lib/popbill/fax.rb, line 38
def getSentListURL(corpNum, userID)
  if corpNum.length != 10
    raise PopbillException.new(-99999999, '사업자등록번호가 올바르지 않습니다.')
  end

  response = httpget("/FAX/?TG=BOX", corpNum, userID)
  response['url']
end
getURL(corpNum, togo, userID = '') click to toggle source
# File lib/popbill/fax.rb, line 30
def getURL(corpNum, togo, userID = '')
  if corpNum.length != 10
    raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
  end
  httpget("/FAX/?TG=#{togo}", corpNum, userID)['url']
end
getUnitCost(corpNum, userID = '') click to toggle source
# File lib/popbill/fax.rb, line 57
def getUnitCost(corpNum, userID = '')
  if corpNum.length != 10
    raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
  end
  httpget("/FAX/UnitCost", corpNum, userID)['unitCost']
end
resendFAXRN(corpNum, orgRequestNum, senderNum, senderName, receiveNum, receiveName, reserveDT = '', userID = '', title = '', requestNum = '') click to toggle source
# File lib/popbill/fax.rb, line 168
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 = '') click to toggle source
# File lib/popbill/fax.rb, line 185
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
resendFax(corpNum, receiptNum, senderNum, senderName, receiveNum, receiveName, reserveDT = '', userID = '', title = '', requestNum = '') click to toggle source
# File lib/popbill/fax.rb, line 130
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 = '') click to toggle source
# File lib/popbill/fax.rb, line 149
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
sendFax(corpNum, senderNum, senderName, receiverNum, receiverName, filePath, reserveDT = '', userID = '', adsYN = false, title = '', requestNum = '') click to toggle source
# File lib/popbill/fax.rb, line 92
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 = '') click to toggle source
# File lib/popbill/fax.rb, line 108
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