Class: ClosedownService

Inherits:
BaseService show all
Defined in:
lib/popbill/closedown.rb

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

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/closedown.rb', line 7

def instance(linkID, secretKey)
  super(linkID, secretKey)
  @instance ||= new
  @instance.addScope("170")
  return @instance
end

Instance Method Details

#checkCorpNum(corpNum, checkCorpNum, userID = '') ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/popbill/closedown.rb', line 30

def checkCorpNum(corpNum, checkCorpNum, userID = '')
  if corpNum.length != 10
    raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
  end

  if checkCorpNum.to_s == ''
    raise PopbillException.new(-99999999, "조회할 사업자등록번호가 입력되지 않았습니다.")
  end

  httpget("/CloseDown?CN=#{checkCorpNum}", corpNum, userID)
end

#checkCorpNums(corpNum, checkCorpNums, userID = '') ⇒ Object



42
43
44
45
46
47
48
49
50
51
# File 'lib/popbill/closedown.rb', line 42

def checkCorpNums(corpNum, checkCorpNums, userID = '')
  if corpNum.length != 10
    raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
  end
  if checkCorpNums.length == 0
    raise PopbillException.new(-99999999, "조회할 사업자등록번호 배열이 입력되지 않았습니다.")
  end

  httppost("/CloseDown", corpNum, checkCorpNums.to_json)
end

#getChargeInfo(corpNum, userID = '') ⇒ Object



16
17
18
19
20
21
# File 'lib/popbill/closedown.rb', line 16

def getChargeInfo(corpNum, userID = '')
  if corpNum.length != 10
    raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
  end
  httpget("/CloseDown/ChargeInfo", corpNum, userID)
end

#getUnitCost(corpNum, userID = '') ⇒ Object



23
24
25
26
27
28
# File 'lib/popbill/closedown.rb', line 23

def getUnitCost(corpNum, userID = '')
  if corpNum.length != 10
    raise PopbillException.new(-99999999, "사업자등록번호가 올바르지 않습니다.")
  end
  httpget("/CloseDown/UnitCost", corpNum, userID)['unitCost']
end