POPBill Developers
가이드

튜토리얼

PowerBuilder 개발환경에서 팝빌 SDK를 추가하여 휴폐업 대량조회 (CheckCorpNums) 함수를 구현하는 예시입니다.

1. POPBiLL SDK 추가

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

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

2. POPBiLL SDK 설정

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

Declare Instance Variables 탭

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

  // 비밀키
  in_closedownservice.secretkey = in_secretkey

  // 휴폐업조회 서비스 객체 선언
  closedownservice in_closedownservice

Window Form Open() 함수

3. CheckCorpNums 기능 구현

Form에 버튼을 생성하고 버튼의 Click Event 코드에 휴폐업 대량조회 (CheckCorpNums) 기능을 추가합니다.

corpstate l_infoList[]
string corpnumList[]
string infoStr
integer i

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

// 조회할 사업자번호 배열, 최대 1000건
corpnumList[1] = "1234567890"
corpnumList[2] = "679-87-00433"
corpnumList[3] = "123-12-12312"

try
  in_closedownSErvice.checkcorpnums(corpnum, corpnumList, l_infoList)

  infoStr += "* type (사업자 과세유형) : null-알수없음, 1-일반과세자, 2-면세과세자, 3-간이과세자, 4-비영리법인, 국가기관 ~n"
  infoStr += "* state (휴폐업상태) : null-알수없음, 0-등록되지 않은 사업자번호, 1-사업중, 2-폐업, 3-휴업~n~n"

  for i = 1 to upperbound(l_infoList)
    If IsNull(l_infoList[i].corpnum) Then  infostr +="corpnum (사업자번호) : ~n" Else infostr += "corpnum (사업자번호) : " +l_infoList[i].corpnum +"~n"
    If IsNull(l_infoList[i].ctype) Then  infostr +="type (사업자 과세유형) : ~n" Else infostr += "type (사업자 과세유형) : " +l_infoList[i].ctype +"~n"
    If IsNull(l_infoList[i].typeDate) Then  infostr +="typeDate (과세유형 전환일자) : ~n" Else infostr += "typeDate (과세유형 전환일자) : " +l_infoList[i].typeDate +"~n"
    If IsNull(l_infoList[i].cstate) Then  infostr +="state (휴폐업상태) : ~n" Else infostr += "state (휴폐업상태) : " +l_infoList[i].cstate +"~n"
    If IsNull(l_infoList[i].stateDate) Then  infostr +="stateDate (휴폐업일자) : ~n" Else infostr += "stateDate (휴폐업일자) : " +l_infoList[i].stateDate +"~n"
    If IsNull(l_infoList[i].checkDate) Then  infostr +="checkDate (국세청 확인일자) : ~n" Else infostr += "checkDate (국세청 확인일자) : " +l_infoList[i].checkDate +"~n~n"
  next

  messagebox("휴폐업조회 - 대량", infoStr)

catch(popbillexception pe)

  messagebox("휴폐업조회 - 대량", "응답코드 : " + String(pe.getcode()) + "~n응답메시지 : " + pe.getmessage())

end try

4. 결과 확인

함수 호출 반환 결과는 아래와 같습니다.
- 성공 : Response code 로 숫자 1 반환
- 실패 : PopbillException 으로 음의 정수 8자리 숫자값 오류코드와 오류메시지 반환 [오류코드]