<commit_before># -*- coding: utf-8 -*-
# Module for Popbill EasyFinBank API. It include base functionality of the
# RESTful web service request and parse json result. It uses Linkhub module
# to accomplish authentication APIs.
#
# http://www.popbill.com
# Author : <NAME> (<EMAIL>)
# Written : 2021-12-27
# Thanks for your interest.

from .base import PopbillBase, PopbillException
try:
    from urllib import parse as parse
except ImportError:
    import urllib as parse

class EasyFinBankService(PopbillBase):
    """ 팝빌 계좌조회 API Service Implementation. """

    def __init__(self, LinkID, SecretKey):
        """ 생성자
            args
                LinkID : 링크허브에서 발급받은 링크아이디(LinkID)
                SecretKeye 링크허브에서 발급받은 비밀키(SecretKey)
        """

        super(self.__class__, self).__init__(LinkID, SecretKey)
        self._addScope("180")

    def registBankAccount(self, CorpNum, AccountInfo, UserID=None):
        """ 계좌등록
            args
                CorpNum : 팝빌회원 사업자번호
                AccountInfo : 등록할 계좌 정보
                UserID : 팝빌회원 아이디
            return
                처리결과. consist of code and message
            raise
                PopbillException
        """

        uri = "/EasyFin/Bank/BankAccount/Regist"
        uri += "?UsePeriod="+AccountInfo.UsePeriod

        postData = self._stringtify(AccountInfo)

        return self._httppost(uri, postData, CorpNum, UserID)

    def updateBankAccount(self, CorpNum, AccountInfo, UserID=None):
        """ 계좌정보 수정
            args
                CorpNum : 팝빌회원 사업자번호
                AccountInfo : 수정할 계좌 정보
                UserID : 팝빌회원 아이디
            return
                처리결과. consist of code and message
            raise
                PopbillException
        """

        uri = "/EasyFin/Bank/BankAccount/"+AccountInfo.BankCode+"/"+AccountInfo.AccountNumber+"/Update"

        postData = self._stringtify(AccountInfo)

        return self._httppost(uri, postData, CorpNum, UserID)


    def closeBankAccount(self, CorpNum, BankCode, AccountNumber, CloseType, UserID=None):
        """ 정액제 해지요청
            args
                CorpNum : 팝빌회원 사업자번호
                BankCode : 기관코드
                AccountNumber : 계좌번호
                CloseType : 해지타입(일반/중도)
                UserID : 팝빌회원 아이디
            return
                처리결과. consist of code and message
            raise
                PopbillException
        """

        uri = "/EasyFin/Bank/BankAccount/Close"
        uri += '?BankCode=' + BankCode
        uri += '&AccountNumber=' + AccountNumber
        uri += '&CloseType=' + CloseType

        return self._httppost(uri, '', CorpNum, UserID)

    def revokeCloseBankAccount(self, CorpNum, BankCode, AccountNumber, UserID=None):
        """ 정액제 해지요청 취소
            args
                CorpNum : 팝빌회원 사업자번호
                BankCode : 기관코드
                AccountNumber : 계좌번호
                UserID : 팝빌회원 아이디
            return
                처리결과. consist of code and message
            raise
                PopbillException<commit_msg>오류 수정<commit_after># -*- coding: utf-8 -*-
# Module for Popbill EasyFinBank API. It include base functionality of the
# RESTful web service request and parse json result. It uses Linkhub module
# to accomplish authentication APIs.
#
# http://www.popbill.com
# Author : <NAME> (<EMAIL>)
# Written : 2021-12-27
# Thanks for your interest.

from .base import PopbillBase, PopbillException
try:
    from urllib import parse as parse
except ImportError:
    import urllib as parse

class EasyFinBankService(PopbillBase):
    """ 팝빌 계좌조회 API Service Implementation. """

    def __init__(self, LinkID, SecretKey):
        """ 생성자
            args
                LinkID : 링크허브에서 발급받은 링크아이디(LinkID)
                SecretKeye 링크허브에서 발급받은 비밀키(SecretKey)
        """

        super(self.__class__, self).__init__(LinkID, SecretKey)
        self._addScope("180")

    def registBankAccount(self, CorpNum, AccountInfo, UserID=None):
        """ 계좌등록
            args
                CorpNum : 팝빌회원 사업자번호
                AccountInfo : 등록할 계좌 정보
                UserID : 팝빌회원 아이디
            return
                처리결과. consist of code and message
            raise
                PopbillException
        """

        uri = "/EasyFin/Bank/BankAccount/Regist"
        uri += "?UsePeriod="+AccountInfo.UsePeriod

        postData = self._stringtify(AccountInfo)

        return self._httppost(uri, postData, CorpNum, UserID)

    def updateBankAccount(self, CorpNum, AccountInfo, UserID=None):
        """ 계좌정보 수정
            args
                CorpNum : 팝빌회원 사업자번호
                AccountInfo : 수정할 계좌 정보
                UserID : 팝빌회원 아이디
            return
                처리결과. consist of code and message
            raise
                PopbillException
        """

        uri = "/EasyFin/Bank/BankAccount/"+AccountInfo.BankCode+"/"+AccountInfo.AccountNumber+"/Update"

        postData = self._stringtify(AccountInfo)

        return self._httppost(uri, postData, CorpNum, UserID)


    def closeBankAccount(self, CorpNum, BankCode, AccountNumber, CloseType, UserID=None):
        """ 정액제 해지요청
            args
                CorpNum : 팝빌회원 사업자번호
                BankCode : 기관코드
                AccountNumber : 계좌번호
                CloseType : 해지타입(일반/중도)
                UserID : 팝빌회원 아이디
            return
                처리결과. consist of code and message
            raise
                PopbillException
        """

        uri = "/EasyFin/Bank/BankAccount/Close"
        uri += '?BankCode=' + BankCode
        uri += '&AccountNumber=' + AccountNumber
        uri += '&CloseType=' + parse.quote(CloseType)

        return self._httppost(uri, '', CorpNum, UserID)

    def revokeCloseBankAccount(self, CorpNum, BankCode, AccountNumber, UserID=None):
        """ 정액제 해지요청 취소
            args
                CorpNum : 팝빌회원 사업자번호
                BankCode : 기관코드
                AccountNumber : 계좌번호
                UserID : 팝빌회원 아이디
            return
                처리결과. consist of code and message
            raise
                PopbillException
{'fraction_non_alphanumeric': 0.08105452759128869, 'fraction_numerical': 0.003929916489274603, 'mean_word_length': 1.7280035730236714, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6586955', 'n_tokens_mistral': 2086, 'n_tokens_neox': 2299, 'n_words': 462}