POPBill Developers
연동신청
  • 가이드 0
  • 레퍼런스 0
  • 오류코드 0
홈택스수집(세금)
  • 전자세금계산서
  • 현금영수증
  • 전자명세서
  • 홈택스수집(세금)
  • 홈택스수집(현금)
  • 사업자등록상태조회
  • 기업정보조회
  • 계좌조회
  • 예금주조회
  • 카카오톡
  • 문자
  • 팩스
ASP
  • Java
  • PHP
  • .NET
  • .NET Core
  • Node.js
  • Python
  • Ruby
  • ASP
  • Delphi
  • PowerBuilder
  • Visual Basic
  • MS Access
SDK 레퍼런스

튜토리얼

팝빌 Webhook 수신 VBScript 예제코드입니다.
팝빌 ASP SDK 예제코드에 포함된 ./Popbill/Linkhub/json2.asp를 사용하여 Webhook JSON Message를 처리합니다.
Webhook 이벤트 메시지의 추가적인 항목은 하단의 [Webhook 메시지 구성]을 참조하시기 바랍니다.

'DocumentRoot/connect.asp

<!--#include file="Popbill/Linkhub/json2.asp"-->

<%

If Request.TotalBytes > 0 Then

  Dim RequestBodyBytes
  RequestBodyBytes = Request.TotalBytes

  'JSON String을 JSON Object로 변환
  Set parse = JSON.parse(BytesToStr(Request.BinaryRead(RequestBodyBytes)))

  eventDT = parse.eventDT 'Webhook 실행일시
  eventType = parse.eventType 'Webhook 유형
  '추가적인 항목은 [Webhook 메시지 구성] 참조

  'Webhook 수신 성공처리를 위해 Response Message "OK" String 반환
  Response.Write "OK"

End If

'Byte 형태의 POST Request Body Message를 String으로 변환하는 함수
Function BytesToStr(bytes)
  Dim Stream
  Set Stream = Server.CreateObject("Adodb.Stream")
    Stream.Type = 1 'adTypeBinary
    Stream.Open
    Stream.Write bytes
    Stream.Position = 0
    Stream.Type = 2 'adTypeText
    Stream.Charset = "UTF-8"
    BytesToStr = Stream.ReadText
    Stream.Close
  Set Stream = Nothing
End Function

%>