コード例 #1
0
        // 알림문자 재전송
        private void btnSendSMS_Click(object sender, EventArgs e)
        {
            try
            {
                //SendSMS(사업자번호, 문서관리번호, 발신번호, 수신번호, 메시지내용, 회원아이디)
                //메시지내용이 90Byte이상인경우 메시지의 길이가 조정되어 전송됩니다.
                Response response = cashbillService.SendSMS(txtCorpNum.Text, txtMgtKey.Text, "1111-2222", "010-111-222", "발신문자 내용...", txtUserId.Text);

                MessageBox.Show(response.message);
            }
            catch (PopbillException ex)
            {
                MessageBox.Show(ex.code.ToString() + " | " + ex.Message);
            }
        }
コード例 #2
0
        /*
         * 현금영수증과 관련된 안내 SMS(단문) 문자를 재전송하는 함수로, 팝빌 사이트 [문자·팩스] > [문자] > [전송내역] 메뉴에서 전송결과를 확인 할 수 있습니다.
         * - 메시지는 최대 90byte까지 입력 가능하고, 초과한 내용은 자동으로 삭제되어 전송합니다. (한글 최대 45자)
         * - 함수 호출 시 포인트가 과금됩니다. (전송실패시 환불처리)
         * - https://docs.popbill.com/cashbill/dotnetcore/api#SendSMS
         */
        public IActionResult SendSMS()
        {
            // 현금영수증 문서번호
            string mgtKey = "20220527-003";

            // 발신자 번호
            string sender = "";

            // 수신자 번호
            string receiver = "";

            // 메시지 내용, 90byte 초과시 길이가 조정되어 전송됨
            string contents = "문자 메시지 내용은 90byte초과시 길이가 조정되어 전송됩니다.";

            try
            {
                var response = _cashbillService.SendSMS(corpNum, mgtKey, sender, receiver, contents);
                return(View("Response", response));
            }
            catch (PopbillException pe)
            {
                return(View("Exception", pe));
            }
        }