POPBill Developers
가이드

튜토리얼

PowerBuilder 개발환경에서 팝빌 SDK를 추가하여 기업정보조회 (BizInfoCheck) 함수를 구현하는 예시입니다.

1. POPBiLL SDK 추가

① 팝빌 연동자료실에서 PowerBuilder SDK 예제코드 다운로드 후 압축을 해제합니다.

② 압축해제한 SDK 예제코드에서 linkhub.pbl, popbill.pbl 파일을 기존 프로젝트 폴더로 복사하고 Library List에 추가합니다.

2. POPBiLL SDK 설정

Window 폼의 Declare Instance Variables 탭에 인증정보와 클래스를 선언하고 open() 함수에 클래스 초기화 코드를 추가합니다.

Declare Instance Variables 탭

// 링크아이디, 연동신청시 발급받은 값으로 변경
string in_linkid = "TESTER"

// 비밀키, 연동신청시 발급받은 값으로 변경
string in_secretkey = "SwWxqU+0TErBXy/9TVjIPEnI0VTUMMSQZtJf3Ed8q3I="

bizinfocheckservice in_bizinfocheckservice

Window Form Open() 함수

in_bizinfocheckservice = create bizinfocheckservice

// 링크아이디
in_bizinfocheckservice.linkid = in_linkid

// 비밀키
in_bizinfocheckservice.secretkey = in_secretkey

// 연동환경 설정값, true-개발용, false-상업용
in_bizinfocheckservice.setIstest(true)

// 인증토큰 IP제한기능 사용여부, true-사용, false-미사용, 기본값(true)
in_bizinfocheckservice.setIPRestrictOnOff(true)

// 로컬시스템 시간 사용여부 true-사용, false-미사용, 기본값(false)
in_bizinfocheckservice.setUseLocalTimeYN(false)

3. BizInfoCheck 기능 구현

Form에 버튼을 생성하고 버튼의 Click Event 코드에 기업정보조회 (BizInfoCheck) 기능을 추가합니다.

bizcheckinfo l_bizcheckinfo
string infoStr

// 팝빌회원 사업자번호
string membercorpnum = "1234567890"

// 조회할 사업자번호
string checkcorpnum = "6798700433"

try
  l_bizcheckinfo = in_bizinfocheckservice.checkbizinfo(membercorpnum, checkcorpnum)

  If IsNull(l_bizcheckinfo.corpnum) Then infostr +="corpNum (사업자번호) : ~n" Else infostr += "corpNum (사업자번호) : " + l_bizcheckinfo.corpnum + "~n"
	If IsNull(l_bizcheckinfo.checkdt) Then infostr +="companyRegNum (법인번호) : ~n" Else infostr += "companyRegNum (법인번호): " + l_bizcheckinfo.checkdt + "~n"
	If IsNull(l_bizcheckinfo.corpname) Then infostr +="checkDT (확인일시) : ~n" Else infostr += "checkDT (확인일시) : " + l_bizcheckinfo.corpname + "~n"
	If IsNull(l_bizcheckinfo.corpcode) Then infostr +="corpName (상호) : ~n" Else infostr += "corpName (상호) : " + l_bizcheckinfo.corpcode + "~n"
	If IsNull(l_bizcheckinfo.corpscalecode) Then infostr +="corpCode (기업형태코드) : ~n" Else infostr += "corpCode (기업형태코드) : " + l_bizcheckinfo.corpscalecode + "~n"
	If IsNull(l_bizcheckinfo.personcorpcode) Then infostr +="corpScaleCode (기업규모코드): ~n" Else infostr += "corpScaleCode (기업규모코드) : " + l_bizcheckinfo.personcorpcode + "~n"
	If IsNull(l_bizcheckinfo.headofficecode) Then infostr +="personCorpCode (개인법인코드): ~n" Else infostr += "personCorpCode (개인법인코드) : " + l_bizcheckinfo.headofficecode + "~n"
	If IsNull(l_bizcheckinfo.industrycode) Then infostr +="headOfficeCode (본점지점코드) : ~n" Else infostr += "headOfficeCode (본점지점코드) : " + l_bizcheckinfo.industrycode + "~n"
	If IsNull(l_bizcheckinfo.companyregnum) Then infostr +="industryCode (산업코드) : ~n" Else infostr += "industryCode (산업코드) : " + l_bizcheckinfo.companyregnum + "~n"
	If IsNull(l_bizcheckinfo.establishdate) Then infostr +="establishCode (설립구분코드) :  ~n" Else infostr += "establishCode (설립구분코드) : " + l_bizcheckinfo.establishdate + "~n"
	If IsNull(l_bizcheckinfo.establishcode) Then infostr +="establishDate (설립일자) : ~n" Else infostr += "establishDate (설립일자) : " + l_bizcheckinfo.establishcode + "~n"
	If IsNull(l_bizcheckinfo.ceoname) Then infostr +="CEOName (대표자명) : ~n" Else infostr += "CEOName (대표자명) : " + l_bizcheckinfo.ceoname + "~n"
	If IsNull(l_bizcheckinfo.workplacecode) Then infostr +="workPlaceCode (사업장구분코드): ~n" Else infostr += "workPlaceCode (사업장구분코드) : " + l_bizcheckinfo.workplacecode + "~n"
	If IsNull(l_bizcheckinfo.addrcode) Then infostr +="addrCode (주소구분코드) : ~n" Else infostr += "addrCode (주소구분코드) : " + l_bizcheckinfo.addrcode + "~n"
	If IsNull(l_bizcheckinfo.zipcode) Then infostr +="zipCode (우편번호) : ~n" Else infostr += "zipCode (우편번호) : " + l_bizcheckinfo.zipcode + "~n"
	If IsNull(l_bizcheckinfo.addr) Then infostr +="addr (주소) : ~n" Else infostr += "addr (주소) : " + l_bizcheckinfo.addr + "~n"
	If IsNull(l_bizcheckinfo.addrdetail) Then infostr +="addrDetail (상세주소) : ~n" Else infostr += "addrDetail (상세주소) : " + l_bizcheckinfo.addrdetail + "~n"
	If IsNull(l_bizcheckinfo.enaddr) Then infostr +="enAddr (영문주소) : ~n" Else infostr += "enAddr (영문주소) : " + l_bizcheckinfo.enaddr + "~n"
	If IsNull(l_bizcheckinfo.bizclass) Then infostr +="bizClass (업종) :  ~n" Else infostr += "bizClass (업종) : " + l_bizcheckinfo.bizclass + "~n"
	If IsNull(l_bizcheckinfo.biztype) Then infostr +="bizType (업태) : ~n" Else infostr += "bizType (업태) : " + l_bizcheckinfo.biztype + "~n"
	If IsNull(l_bizcheckinfo.result) Then infostr +="result (결과코드) : ~n" Else infostr += "result (결과코드) : " + l_bizcheckinfo.result + "~n"
	If IsNull(l_bizcheckinfo.resultmessage) Then infostr +="resultMessage (결과메시지) : ~n" Else infostr += "resultMessage (결과메시지) : " + l_bizcheckinfo.resultmessage + "~n"
	If IsNull(l_bizcheckinfo.closedowntaxtype) Then infostr +="closeDownTaxType (사업자과세유형) : ~n" Else infostr += "closeDownTaxType (사업자과세유형 : " + l_bizcheckinfo.closedowntaxtype + "~n"
	If IsNull(l_bizcheckinfo.closedowntaxtypedate) Then infostr +="closeDownTaxTypeDate (과세유형전환일자): ~n" Else infostr += "closeDownTaxTypeDate (과세유형전환일자) : " + l_bizcheckinfo.closedowntaxtypedate + "~n"
	If IsNull(l_bizcheckinfo.closedownstate) Then infostr +="closeDownState (휴폐업상태) : ~n" Else infostr += "closeDownState (휴폐업상태) : " + l_bizcheckinfo.closedownstate + "~n"
	If IsNull(l_bizcheckinfo.closedownstatedate) Then infostr +="closeDownStateDate (휴폐업일자) : ~n" Else infostr += "closeDownStateDate (휴폐업일자) : " + l_bizcheckinfo.closedownstatedate + "~n"

  messagebox("기업정보조회", infoStr)

catch(popbillexception pe)

  messagebox("기업정보조회", "응답코드 : " + String(pe.getcode()) + "~n응답메시지 : " + pe.getmessage())

end try

4. 결과 확인

함수 호출이 정상적으로 처리된 경우 Response가 "성공"으로 반환되며, 실패일 경우 PopbillException으로 오류코드("-"로 시작하는 8자리 숫자값)와 오류메시지가 반환됩니다. [오류코드] 바로가기