// 현금영수증 상세항목 확인 private void btnGetDetailInfo_Click(object sender, EventArgs e) { try { Cashbill cashbill = cashbillService.GetDetailInfo(txtCorpNum.Text, txtMgtKey.Text); //자세한 문세정보는 작성시 항목을 참조하거나, 연동메뉴얼 참조. string tmp = null; tmp += "mgtKey: " + cashbill.mgtKey + CRLF; tmp += "tradeDate : " + cashbill.tradeDate + CRLF; tmp += "tradeUsage : " + cashbill.tradeUsage + CRLF; tmp += "tradeType : " + cashbill.tradeType + CRLF; tmp += "taxationType : " + cashbill.taxationType + CRLF; tmp += "supplyCost : " + cashbill.supplyCost + CRLF; tmp += "tax : " + cashbill.tax + CRLF; tmp += "serviceFee : " + cashbill.serviceFee + CRLF; tmp += "totalAmount : " + cashbill.totalAmount + CRLF; tmp += "franchiseCorpNum : " + cashbill.franchiseCorpNum + CRLF; tmp += "franchiseCorpName : " + cashbill.franchiseCorpName + CRLF; tmp += "franchiseCEOName : " + cashbill.franchiseCEOName + CRLF; tmp += "franchiseAddr : " + cashbill.franchiseAddr + CRLF; tmp += "franchiseTEL : " + cashbill.franchiseTEL + CRLF; tmp += "identityNum : " + cashbill.identityNum + CRLF; tmp += "customerName : " + cashbill.customerName + CRLF; tmp += "itemName : " + cashbill.itemName + CRLF; tmp += "orderNumber : " + cashbill.orderNumber + CRLF; tmp += "email : " + cashbill.email + CRLF; tmp += "hp : " + cashbill.hp + CRLF; tmp += "smssendYN : " + cashbill.smssendYN + CRLF; tmp += "faxsendYN : " + cashbill.faxsendYN + CRLF; MessageBox.Show(tmp); } catch (PopbillException ex) { MessageBox.Show(ex.code.ToString() + " | " + ex.Message); } }
private void btnUpdate_Click(object sender, EventArgs e) { Cashbill cashbill = new Cashbill(); cashbill.mgtKey = txtMgtKey.Text; //발행자별 고유번호 할당, 1~24자리 영문,숫자조합으로 중복없이 구성. cashbill.tradeType = "승인거래"; //승인거래 or 취소거래 cashbill.franchiseCorpNum = txtCorpNum.Text; cashbill.franchiseCorpName = "발행자 상호_수정"; cashbill.franchiseCEOName = "발행자 대표자"; cashbill.franchiseAddr = "발행자 주소"; cashbill.franchiseTEL = "070-1234-1234"; cashbill.identityNum = "01041680206"; cashbill.customerName = "고객명"; cashbill.itemName = "상품명"; cashbill.orderNumber = "주문번호"; cashbill.email = "*****@*****.**"; cashbill.hp = "111-1234-1234"; cashbill.fax = "777-444-3333"; cashbill.serviceFee = "0"; cashbill.supplyCost = "10000"; cashbill.tax = "1000"; cashbill.totalAmount = "11000"; cashbill.tradeUsage = "소득공제용"; //소득공제용 or 지출증빙용 cashbill.taxationType = "과세"; //과세 or 비과세 cashbill.smssendYN = false; try { Response response = cashbillService.Update(txtCorpNum.Text, txtMgtKey.Text, cashbill, txtUserId.Text); MessageBox.Show(response.message); } catch (PopbillException ex) { MessageBox.Show(ex.code.ToString() + " | " + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { /** * 현금영수증 1건의 상세정보를 확인합니다. * - https://docs.popbill.com/cashbill/dotnet/api#GetDetailInfo */ // 팝빌회원 사업자번호, '-' 제외 10자리 String testCorpNum = "1234567890"; // 현금영수증 문서번호 String mgtKey = "20220525-001"; try { cashbill = Global.cashbillService.GetDetailInfo(testCorpNum, mgtKey); } catch (PopbillException ex) { code = ex.code.ToString(); message = ex.Message; } }
/* * 작성된 현금영수증 데이터를 팝빌에 저장과 동시에 발행하여 "발행완료" 상태로 처리합니다. * - 현금영수증 국세청 전송 정책 : https://docs.popbill.com/cashbill/ntsSendPolicy?lang=dotnetcore * - "발행완료"된 현금영수증은 국세청 전송 이전에 발행취소(CancelIssue API) 함수로 국세청 신고 대상에서 제외할 수 있습니다. * - https://docs.popbill.com/cashbill/dotnetcore/api#RegistIssue */ public IActionResult RegistIssue() { // 현금영수증 정보 객체 Cashbill cashbill = new Cashbill(); // 문서번호, 사업자별로 중복되지 않도록 문서번호 할당 // 1~24자리 영문,숫자,'-','_' 조합 구성 cashbill.mgtKey = "20220527-001"; // 문서형태, 승인거래 기재 cashbill.tradeType = "승인거래"; // 거래구분, { 소득공제용, 지출증빙용 } 중 기재 cashbill.tradeUsage = "소득공제용"; // 거래유형, { 일반, 도서공연, 대중교통 } 중 기재 // - 미입력 시 기본값 "일반" 처리 cashbill.tradeOpt = "일반"; // 과세형태, { 과세, 비과세 } 중 기재 cashbill.taxationType = "과세"; // 거래금액 ( 공급가액 + 세액 + 봉사료 ) cashbill.totalAmount = "11000"; // 공급가액 cashbill.supplyCost = "10000"; // 부가세 cashbill.tax = "1000"; // 봉사료 cashbill.serviceFee = "0"; // 가맹점 사업자번호 cashbill.franchiseCorpNum = corpNum; // 가맹점 종사업장 식별번호 cashbill.franchiseTaxRegID = ""; // 가맹점 상호 cashbill.franchiseCorpName = "가맹점 상호"; // 가맹점 대표자 성명 cashbill.franchiseCEOName = "가맹점 대표자"; // 가맹점 주소 cashbill.franchiseAddr = "가맹점 주소"; // 가맹점 전화번호 cashbill.franchiseTEL = ""; // 식별번호, 거래구분에 따라 작성 // └ 소득공제용 - 주민등록/휴대폰/카드번호(현금영수증 카드)/자진발급용 번호(010-000-1234) 기재가능 // └ 지출증빙용 - 사업자번호/주민등록/휴대폰/카드번호(현금영수증 카드) 기재가능 // └ 주민등록번호 13자리, 휴대폰번호 10~11자리, 카드번호 13~19자리, 사업자번호 10자리 입력 가능 cashbill.identityNum = "0100001234"; // 주문자명 cashbill.customerName = "주문자명"; // 주문상품명 cashbill.itemName = "주문상품명"; // 주문번호 cashbill.orderNumber = "주문번호"; // 주문자 이메일 // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로, // 실제 거래처의 메일주소가 기재되지 않도록 주의 cashbill.email = ""; // 주문자 휴대폰 // - {smssendYN} 의 값이 true 인 경우 아래 휴대폰번호로 안내 문자 전송 cashbill.hp = ""; // 주문자 팩스번호 cashbill.fax = ""; // 발행시 알림문자 전송여부 cashbill.smssendYN = false; // 현금영수증 발행 메모 string memo = "현금영수증 즉시발행 메모"; // 메일제목, 공백처리시 기본양식으로 전송 string emailSubject = ""; try { var response = _cashbillService.RegistIssue(corpNum, cashbill, memo, userID, emailSubject); return(View("IssueResponse", response)); } catch (PopbillException pe) { return(View("Exception", pe)); } }
/* * 최대 100건의 현금영수증 발행을 한번의 요청으로 접수합니다. * - https://docs.popbill.com/cashbill/dotnetcore/api#BulkSubmit */ public IActionResult BulkSubmit() { // 제출아이디 string submitID = "20220527-BULK"; // 현금영수증 객체정보 목록 List <Cashbill> cashbillList = new List <Cashbill>(); for (int i = 0; i < 100; i++) { Cashbill cashbill = new Cashbill(); // 문서번호, 최대 24자리, 영문, 숫자 '-', '_'를 조합하여 사업자별로 중복되지 않도록 구성 cashbill.mgtKey = submitID + "-" + i; // [취소거래시 필수] 원본 현금영수증 국세청승인번호 cashbill.orgConfirmNum = ""; // [취소거래시 필수] 원본 현금영수증 거래일자 cashbill.orgTradeDate = ""; // 문서형태, { 승인거래, 취소거래 } 중 기재 cashbill.tradeType = "승인거래"; // 거래구분, { 소득공제용, 지출증빙용 } 중 기재 cashbill.tradeUsage = "소득공제용"; // 거래유형, { 일반, 도서공연, 대중교통 } 중 기재 cashbill.tradeOpt = "일반"; // 과세형태, { 과세, 비과세 } 중 기재 cashbill.taxationType = "과세"; // 거래금액 ( 공급가액 + 세액 + 봉사료 ) cashbill.totalAmount = "11000"; // 공급가액 cashbill.supplyCost = "10000"; // 부가세 cashbill.tax = "1000"; // 봉사료 cashbill.serviceFee = "0"; // 가맹점 사업자번호 cashbill.franchiseCorpNum = corpNum; // 가맹점 종사업장 식별번호 cashbill.franchiseTaxRegID = ""; // 가맹점 상호 cashbill.franchiseCorpName = "가맹점 상호"; // 가맹점 대표자 성명 cashbill.franchiseCEOName = "가맹점 대표자 성명"; // 가맹점 주소 cashbill.franchiseAddr = "가맹점 주소"; // 가맹점 전화번호 cashbill.franchiseTEL = ""; // 식별번호, 거래구분에 따라 작성 // └ 소득공제용 - 주민등록/휴대폰/카드번호(현금영수증 카드)/자진발급용 번호(010-000-1234) 기재가능 // └ 지출증빙용 - 사업자번호/주민등록/휴대폰/카드번호(현금영수증 카드) 기재가능 // └ 주민등록번호 13자리, 휴대폰번호 10~11자리, 카드번호 13~19자리, 사업자번호 10자리 입력 가능 cashbill.identityNum = "0100001234"; // 주문자명 cashbill.customerName = "주문자명"; // 주문상품명 cashbill.itemName = "주문상품명"; // 주문번호 cashbill.orderNumber = "주문번호"; // 주문자 이메일 // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로, // 실제 거래처의 메일주소가 기재되지 않도록 주의 cashbill.email = ""; // 주문자 휴대폰 // - {smssendYN} 의 값이 true 인 경우 아래 휴대폰번호로 안내 문자 전송 cashbill.hp = ""; // 주문자 팩스번호 cashbill.fax = ""; // 발행시 알림문자 전송여부 cashbill.smssendYN = false; cashbillList.Add(cashbill); } try { var bulkResponse = _cashbillService.BulkSubmit(corpNum, submitID, cashbillList); return(View("BulkResponse", bulkResponse)); } catch (PopbillException pe) { return(View("Exception", pe)); } }
/* * 1건의 현금영수증을 [수정]합니다. * - [임시저장] 상태의 현금영수증만 수정할 수 있습니다. * - 국세청에 신고된 현금영수증은 수정할 수 없으며, 취소 현금영수증을 발행하여 취소처리 할 수 있습니다. */ public IActionResult Update() { // 수정할 현금영수증 문서번호 string mgtKey = "20211222-002"; // 현금영수증 정보 객체 Cashbill cashbill = new Cashbill(); // [취소거래시 필수] 원본 현금영수증 국세청승인번호 cashbill.orgConfirmNum = ""; // [취소거래시 필수] 원본 현금영수증 거래일자 cashbill.orgTradeDate = ""; // 문서형태, { 승인거래, 취소거래 } 중 기재 cashbill.tradeType = "승인거래"; // 거래구분, { 소득공제용, 지출증빙용 } 중 기재 cashbill.tradeUsage = "소득공제용"; // 거래유형, { 일반, 도서공연, 대중교통 } 중 기재 cashbill.tradeOpt = "도서공연"; // 과세형태, { 과세, 비과세 } 중 기재 cashbill.taxationType = "과세"; // 거래금액 ( 공급가액 + 세액 + 봉사료 ) cashbill.totalAmount = "11000"; // 공급가액 cashbill.supplyCost = "10000"; // 부가세 cashbill.tax = "1000"; // 봉사료 cashbill.serviceFee = "0"; // 가맹점 사업자번호 cashbill.franchiseCorpNum = corpNum; // 가맹점 종사업장 식별번호 cashbill.franchiseTaxRegID = ""; // 가맹점 상호 cashbill.franchiseCorpName = "가맹점 상호"; // 가맹점 대표자 성명 cashbill.franchiseCEOName = "가맹점 대표자"; // 가맹점 주소 cashbill.franchiseAddr = "가맹점 주소"; // 가맹점 전화번호 cashbill.franchiseTEL = "070-1234-1234"; // 식별번호 // 거래구분(tradeUsage) - '소득공제용' 인 경우 주민등록/휴대폰/카드번호 기재 가능 // 거래구분(tradeUsage) - '지출증빙용' 인 경우 사업자번호/주민등록/휴대폰/카드번호 기재 가능 cashbill.identityNum = "2"; // 주문자명 cashbill.customerName = "주문자명"; // 주문상품명 cashbill.itemName = "주문상품명"; // 주문번호 cashbill.orderNumber = "주문번호"; // 주문자 이메일 // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로, // 실제 거래처의 메일주소가 기재되지 않도록 주의 cashbill.email = ""; // 주문자 휴대폰 cashbill.hp = ""; // 주문자 팩스번호 cashbill.fax = ""; // 발행시 알림문자 전송여부 cashbill.smssendYN = false; try { var response = _cashbillService.Update(corpNum, mgtKey, cashbill, userID); return(View("Response", response)); } catch (PopbillException pe) { return(View("Exception", pe)); } }
protected void Page_Load(object sender, EventArgs e) { /* * 최대 100건의 현금영수증 발행을 한번의 요청으로 접수합니다. * - https://docs.popbill.com/cashbill/dotnet/api#BulkSubmit */ // 팝빌회원 사업자번호, '-' 제외 10자리 String testCorpNum = "1234567890"; // 제출아이디, 대량 발행 접수를 구별하는 식별키 // └ 최대 36자리 영문, 숫자, '-' 조합으로 구성 String submitID = "20220525-BULK"; // 현금영수증 객체정보 목록 List <Cashbill> cashbillList = new List <Cashbill>(); for (int i = 0; i < 100; i++) { // 현금영수증 객체 생성 Cashbill cashbill = new Cashbill(); // 문서번호, 최대 24자리, 영문, 숫자 '-', '_'를 조합하여 사업자별로 중복되지 않도록 구성 cashbill.mgtKey = submitID + "-" + i; //// [취소거래시 필수] 원본 현금영수증 국세청승인번호 //cashbill.orgConfirmNum = ""; //// [취소거래시 필수] 원본 현금영수증 거래일자 //cashbill.orgTradeDate = ""; // 문서형태, { 승인거래, 취소거래 } 중 기재 cashbill.tradeType = "승인거래"; // 거래구분, { 소득공제용, 지출증빙용 } 중 기재 cashbill.tradeUsage = "소득공제용"; // 거래유형, {일반, 도서공연, 대중교통} 중 기재 // - 미입력시 기본값 "일반" 처리 cashbill.tradeOpt = "일반"; // 과세형태, { 과세, 비과세 } 중 기재 cashbill.taxationType = "과세"; // 거래금액 ( 공급가액 + 세액 + 봉사료 ) cashbill.totalAmount = "11000"; // 공급가액 cashbill.supplyCost = "10000"; // 부가세 cashbill.tax = "1000"; // 봉사료 cashbill.serviceFee = "0"; // 가맹점 사업자번호 cashbill.franchiseCorpNum = testCorpNum; // 가맹점 종사업장 식별번호 cashbill.franchiseTaxRegID = ""; // 가맹점 상호 cashbill.franchiseCorpName = "가맹점 상호"; // 가맹점 대표자 성명 cashbill.franchiseCEOName = "가맹점 대표자 성명"; // 가맹점 주소 cashbill.franchiseAddr = "가맹점 주소"; // 가맹점 전화번호 cashbill.franchiseTEL = ""; // 식별번호, 거래구분에 따라 작성 // └ 소득공제용 - 주민등록/휴대폰/카드번호(현금영수증 카드)/자진발급용 번호(010-000-1234) 기재가능 // └ 지출증빙용 - 사업자번호/주민등록/휴대폰/카드번호(현금영수증 카드) 기재가능 // └ 주민등록번호 13자리, 휴대폰번호 10~11자리, 카드번호 13~19자리, 사업자번호 10자리 입력 가능 cashbill.identityNum = "0100001234"; // 주문자명 cashbill.customerName = "주문자명"; // 주문상품명 cashbill.itemName = "주문상품명"; // 주문번호 cashbill.orderNumber = "주문번호"; // 주문자 이메일 // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로, // 실제 거래처의 메일주소가 기재되지 않도록 주의 cashbill.email = ""; // 주문자 휴대폰 // - {smssendYN} 의 값이 true 인 경우 아래 휴대폰번호로 안내 문자 전송 cashbill.hp = ""; // 주문자 팩스번호 cashbill.fax = ""; // 발행시 알림문자 전송여부 cashbill.smssendYN = false; cashbillList.Add(cashbill); } try { BulkResponse response = Global.cashbillService.BulkSubmit(testCorpNum, submitID, cashbillList); code = response.code.ToString(); message = response.message; receiptID = response.receiptID; } catch (PopbillException ex) { code = ex.code.ToString(); message = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { /** * 1건의 현금영수증을 [수정]합니다. * - [임시저장] 상태의 현금영수증만 수정할 수 있습니다. * - 국세청에 신고된 현금영수증은 수정할 수 없으며, 취소 현금영수증을 발행하여 취소처리 할 수 있습니다. */ // 팝빌회원 사업자번호, '-' 제외 10자리 String testCorpNum = "1234567890"; // 팝빌회원 아이디 String testUserID = "testkorea"; // 현금영수증 문서번호 String mgtKey = "20220525-001"; // 현금영수증 정보 객체 Cashbill cashbill = new Cashbill(); // 문서번호, 최대 24자리, 영문, 숫자 '-', '_'를 조합하여 사업자별로 중복되지 않도록 구성 cashbill.mgtKey = mgtKey; // 문서형태, {승인거래, 취소거래} 중 기재 cashbill.tradeType = "승인거래"; // 거래구분, {소득공제용, 지출증빙용} 중 기재 cashbill.tradeUsage = "소득공제용"; // 거래유형, {일반, 도서공연, 대중교통} 중 기재 // - 미입력시 기본값 "일반" 처리 cashbill.tradeOpt = "일반"; // 과세형태, { 과세, 비과세 } 중 기재 cashbill.taxationType = "과세"; // 거래금액 ( 공급가액 + 세액 + 봉사료 ) cashbill.totalAmount = "11000"; // 공급가액 cashbill.supplyCost = "10000"; // 부가세 cashbill.tax = "1000"; // 봉사료 cashbill.serviceFee = "0"; // 가맹점 사업자번호 cashbill.franchiseCorpNum = testCorpNum; // 가맹점 종사업장 식별번호 cashbill.franchiseTaxRegID = ""; // 가맹점 상호 cashbill.franchiseCorpName = "발행자 상호_수정"; // 가맹점 대표자 성명 cashbill.franchiseCEOName = "발행자 대표자_수정"; // 가맹점 주소 cashbill.franchiseAddr = "발행자 주소"; // 가맹점 전화번호 cashbill.franchiseTEL = ""; // 식별번호, 거래구분에 따라 작성 // └ 소득공제용 - 주민등록/휴대폰/카드번호(현금영수증 카드)/자진발급용 번호(010-000-1234) 기재가능 // └ 지출증빙용 - 사업자번호/주민등록/휴대폰/카드번호(현금영수증 카드) 기재가능 // └ 주민등록번호 13자리, 휴대폰번호 10~11자리, 카드번호 13~19자리, 사업자번호 10자리 입력 가능 cashbill.identityNum = "0100001234"; // 주문자명 cashbill.customerName = "고객명"; // 주문상품명 cashbill.itemName = "상품명"; // 주문번호 cashbill.orderNumber = "주문번호"; // 주문자 이메일 // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로, // 실제 거래처의 메일주소가 기재되지 않도록 주의 cashbill.email = ""; // 주문자 휴대폰 // - {smssendYN} 의 값이 true 인 경우 아래 휴대폰번호로 안내 문자 전송 cashbill.hp = ""; // 주문자 팩스번호 cashbill.fax = ""; // 발행시 알림문자 전송여부 cashbill.smssendYN = false; try { Response response = Global.cashbillService.Update(testCorpNum, mgtKey, cashbill, testUserID); code = response.code.ToString(); message = response.message; } catch (PopbillException ex) { code = ex.code.ToString(); message = ex.Message; } }
/* * 1건의 현금영수증을 [즉시발행]합니다. * - 발행일 기준 오후 5시 이전에 발행된 현금영수증은 다음날 오후 2시에 국세청 전송결과를 확인할 수 있습니다. * - 현금영수증 국세청 전송 정책에 대한 정보는 "[현금영수증 API 연동매뉴얼] > 1.3. 국세청 전송정책"을 참조하시기 바랍니다. * - https://docs.popbill.com/cashbill/dotnetcore/api#RegistIssue */ public IActionResult RegistIssue() { // 현금영수증 정보 객체 Cashbill cashbill = new Cashbill(); // [필수] 문서번호, 사업자별로 중복되지 않도록 문서번호 할당 // 1~24자리 영문,숫자,'-','_' 조합 구성 cashbill.mgtKey = "20200526-002"; // [취소거래시 필수] 원본 현금영수증 국세청승인번호 cashbill.orgConfirmNum = ""; // [취소거래시 필수] 원본 현금영수증 거래일자 cashbill.orgTradeDate = ""; // [필수] 문서형태, { 승인거래, 취소거래 } 중 기재 cashbill.tradeType = "승인거래"; // [필수] 거래구분, { 소득공제용, 지출증빙용 } 중 기재 cashbill.tradeUsage = "소득공제용"; // 거래유형, { 일반, 도서공연, 대중교통 } 중 기재 cashbill.tradeOpt = "일반"; // [필수] 과세형태, { 과세, 비과세 } 중 기재 cashbill.taxationType = "과세"; // [필수] 거래금액 ( 공급가액 + 세액 + 봉사료 ) cashbill.totalAmount = "11000"; // [필수] 공급가액 cashbill.supplyCost = "10000"; // [필수] 부가세 cashbill.tax = "1000"; // [필수] 봉사료 cashbill.serviceFee = "0"; // [필수] 가맹점 사업자번호 cashbill.franchiseCorpNum = corpNum; // 가맹점 상호 cashbill.franchiseCorpName = "가맹점 상호"; // 가맹점 대표자 성명 cashbill.franchiseCEOName = "가맹점 대표자"; // 가맹점 주소 cashbill.franchiseAddr = "가맹점 주소"; // 가맹점 전화번호 cashbill.franchiseTEL = "070-1234-1234"; // [필수] 식별번호 // 거래구분(tradeUsage) - '소득공제용' 인 경우 주민등록/휴대폰/카드번호 기재 가능 // 거래구분(tradeUsage) - '지출증빙용' 인 경우 사업자번호/주민등록/휴대폰/카드번호 기재 가능 cashbill.identityNum = "0101112222"; // 주문자명 cashbill.customerName = "주문자명"; // 주문상품명 cashbill.itemName = "주문상품명"; // 주문번호 cashbill.orderNumber = "주문번호"; // 주문자 이메일 // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로, // 실제 거래처의 메일주소가 기재되지 않도록 주의 cashbill.email = "*****@*****.**"; // 주문자 휴대폰 cashbill.hp = "010-111-222"; // 주문자 팩스번호 cashbill.fax = "02-6442-9700"; // 발행시 알림문자 전송여부 cashbill.smssendYN = false; // 현금영수증 발행 메모 string memo = "현금영수증 즉시발행 메모"; // 메일제목, 공백처리시 기본양식으로 전송 string emailSubject = ""; try { var response = _cashbillService.RegistIssue(corpNum, cashbill, memo, userID, emailSubject); return(View("Response", response)); } catch (PopbillException pe) { return(View("Exception", pe)); } }
protected void Page_Load(object sender, EventArgs e) { /** * 현금영수증 데이터를 팝빌에 전송하여 발행합니다. * - 현금영수증 국세청 전송 정책 : https://docs.popbill.com/cashbill/ntsSendPolicy?lang=dotnet * - https://docs.popbill.com/cashbill/dotnet/api#RegistIssue */ // 팝빌회원 사업자번호, '-' 제외 10자리 String testCorpNum = "1234567890"; // 팝빌회원 아이디 String testUserID = "testkorea"; // 현금영수증 문서번호 String mgtKey = "20220525-001"; // 메모 String memo = "즉시발행 메모"; // 안내메일 제목, 공백처리시 기본양식으로 전송 String emailSubject = ""; // 현금영수증 정보 객체 Cashbill cashbill = new Cashbill(); // 문서번호, 최대 24자리, 영문, 숫자 '-', '_'를 조합하여 사업자별로 중복되지 않도록 구성 cashbill.mgtKey = mgtKey; // 문서형태, {승인거래, 취소거래} 중 기재 cashbill.tradeType = "승인거래"; // 거래구분, {소득공제용, 지출증빙용} 중 기재 cashbill.tradeUsage = "소득공제용"; // 거래유형, {일반, 도서공연, 대중교통} 중 기재 // - 미입력시 기본값 "일반" 처리 cashbill.tradeOpt = "일반"; // 과세형태, { 과세, 비과세 } 중 기재 cashbill.taxationType = "과세"; // 거래금액 ( 공급가액 + 세액 + 봉사료 ) cashbill.totalAmount = "11000"; // 공급가액 cashbill.supplyCost = "10000"; // 부가세 cashbill.tax = "1000"; // 봉사료 cashbill.serviceFee = "0"; // 가맹점 사업자번호 cashbill.franchiseCorpNum = testCorpNum; // 가맹점 종사업장 식별번호 cashbill.franchiseTaxRegID = ""; // 가맹점 상호 cashbill.franchiseCorpName = "발행자 상호"; // 가맹점 대표자 성명 cashbill.franchiseCEOName = "발행자 대표자"; // 가맹점 주소 cashbill.franchiseAddr = "발행자 주소"; // 가맹점 전화번호 cashbill.franchiseTEL = ""; // 식별번호, 거래구분에 따라 작성 // └ 소득공제용 - 주민등록/휴대폰/카드번호(현금영수증 카드)/자진발급용 번호(010-000-1234) 기재가능 // └ 지출증빙용 - 사업자번호/주민등록/휴대폰/카드번호(현금영수증 카드) 기재가능 // └ 주민등록번호 13자리, 휴대폰번호 10~11자리, 카드번호 13~19자리, 사업자번호 10자리 입력 가능 cashbill.identityNum = "0100001234"; // 주문자명 cashbill.customerName = "고객명"; // 주문상품명 cashbill.itemName = "상품명"; // 주문번호 cashbill.orderNumber = "주문번호"; // 주문자 메일 // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로, // 실제 거래처의 메일주소가 기재되지 않도록 주의 cashbill.email = ""; // 주문자 휴대폰 // - {smssendYN} 의 값이 true 인 경우 아래 휴대폰번호로 안내 문자 전송 cashbill.hp = ""; // 주문자 팩스번호 cashbill.fax = ""; // 발행시 알림문자 전송여부 cashbill.smssendYN = false; try { CBIssueResponse response = Global.cashbillService.RegistIssue(testCorpNum, cashbill, memo, testUserID, emailSubject); code = response.code.ToString(); message = response.message; confirmNum = response.confirmNum; tradeDate = response.tradeDate; } catch (PopbillException ex) { code = ex.code.ToString(); message = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { /** * 1건의 현금영수증을 [임시저장]합니다. * - [임시저장] 상태의 현금영수증은 발행(Issue API)을 호출해야만 국세청에 전송됩니다. */ // 팝빌회원 사업자번호, '-' 제외 10자리 String testCorpNum = "1234567890"; // 현금영수증 문서번호 String mgtKey = "20220525-011"; // 현금영수증 정보 객체 Cashbill cashbill = new Cashbill(); // [필수] 문서번호, 최대 24자리, 영문, 숫자 '-', '_'를 조합하여 사업자별로 중복되지 않도록 구성 cashbill.mgtKey = mgtKey; // [필수] 문서형태, {승인거래, 취소거래} 중 기재 cashbill.tradeType = "승인거래"; // [필수] 거래구분, {소득공제용, 지출증빙용} 중 기재 cashbill.tradeUsage = "소득공제용"; // [필수] 거래유형, {일반, 도서공연, 대중교통} 중 기재 cashbill.tradeOpt = "일반"; // [필수] 과세형태, { 과세, 비과세 } 중 기재 cashbill.taxationType = "과세"; // [필수] 거래금액 ( 공급가액 + 세액 + 봉사료 ) cashbill.totalAmount = "11000"; // [필수] 공급가액 cashbill.supplyCost = "10000"; // [필수] 부가세 cashbill.tax = "1000"; // [필수] 봉사료 cashbill.serviceFee = "0"; // [필수] 가맹점 사업자번호 cashbill.franchiseCorpNum = testCorpNum; // 가맹점 종사업장 식별번호 cashbill.franchiseTaxRegID = ""; // 가맹점 상호 cashbill.franchiseCorpName = "발행자 상호"; // 가맹점 대표자 성명 cashbill.franchiseCEOName = "발행자 대표자"; // 가맹점 주소 cashbill.franchiseAddr = "발행자 주소"; // 가맹점 전화번호 cashbill.franchiseTEL = "070-1234-1234"; // [필수] 식별번호 // 거래구분(tradeUsage) - '소득공제용' 인 경우 // - 주민등록/휴대폰/카드번호 기재 가능 // 거래구분(tradeUsage) - '지출증빙용' 인 경우 // - 사업자번호/주민등록/휴대폰/카드번호 기재 가능 cashbill.identityNum = "0101112222"; // 주문자명 cashbill.customerName = "고객명"; // 주문상품명 cashbill.itemName = "상품명"; // 주문번호 cashbill.orderNumber = "주문번호"; // 주문자 메일 // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로, // 실제 거래처의 메일주소가 기재되지 않도록 주의 cashbill.email = "*****@*****.**"; // 주문자 휴대폰 cashbill.hp = "010-111-222"; // 주문자 팩스번호 cashbill.fax = "02-111-222"; // 발행시 알림문자 전송여부 cashbill.smssendYN = false; try { Response response = Global.cashbillService.Register(testCorpNum, cashbill); code = response.code.ToString(); message = response.message; } catch (PopbillException ex) { code = ex.code.ToString(); message = ex.Message; } }