当前位置: 首页>>代码示例>>Python>>正文


Python Client.didww_getdidwwpstnrates方法代码示例

本文整理汇总了Python中suds.client.Client.didww_getdidwwpstnrates方法的典型用法代码示例。如果您正苦于以下问题:Python Client.didww_getdidwwpstnrates方法的具体用法?Python Client.didww_getdidwwpstnrates怎么用?Python Client.didww_getdidwwpstnrates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在suds.client.Client的用法示例。


在下文中一共展示了Client.didww_getdidwwpstnrates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Didww

# 需要导入模块: from suds.client import Client [as 别名]
# 或者: from suds.client.Client import didww_getdidwwpstnrates [as 别名]
class Didww(object):

    def get_mapping(self, type, proto, detail, pref_server, itsp_id):
        return {
            'map_type' : type,
            'map_proto': proto,
            'map_detail': detail,
            'map_pref_server': pref_server,
            'map_itsp_id': itsp_id
        }


    def __init__(self, username, api_key, sandbox):
        """ initialise the DIDWW API
        @param username : didww username
        @param api_key  : didww api_key
        @param sandbox  : boolean
        """
        self.username = username

        if sandbox:
            self.url = 'https://sandbox2.didww.com/api2/?wsdl'
            self.auth_string = hashlib.sha1(username + api_key).hexdigest()

        else:
            self.auth_string = hashlib.sha1(username + api_key + 'sandbox').hexdigest()
            self.url = 'http://api.didww.com/api/?wsdl'

        self.client = Client(self.url)

    def get_regions(self, country_iso=None, city_prefix=None, last_request_gmt=None):
        """
        This method will return list of regions from DIDWW coverage list
        """
        return self.client.didww_getdidwwregions(auth_string=self.auth_string,
                           country_iso = country_iso,
                           city_prefix = city_prefix,
                           last_request_gmt = last_request_gmt)


    def get_pstn_rates(self, country_iso=None, pstn_prefix=None, last_request_gmt=None):
        """
        This method will return list of supported PSTN prefixes from DIDWW.
        """
        return self.client.didww_getdidwwpstnrates(auth_string = self.auth_string,
                                                   country_iso = country_iso,
                                                   pstn_prefix = pstn_prefix,
                                                   last_request_gmt = last_request_gmt)


    def check_pstn_number(self, pstn_number):
        """
        This method will validate a PSTN Number.
        """
        return self.client.didww_checkpstnnumber(auth_string = self.auth_string,
                                                 pstn_number = pstn_number)


    def order_create(self, customer_id, country_iso, city_prefix, period, map_data, prepaid_funds, uniq_hash, city_id):
        """
        This method will purchase new service
        """
        return self.client.didww_ordercreate(auth_string = self.auth_string,
                                             customer_id = customer_id,
                                             country_iso = country_iso,
                                             city_prefix = city_prefix,
                                             period = period,
                                             map_data = map_data,
                                             prepaid_funds = prepaid_funds,
                                             uniq_hash = uniq_hash,
                                             city_id = city_id)
开发者ID:Fivell,项目名称:didww,代码行数:73,代码来源:__init__.py


注:本文中的suds.client.Client.didww_getdidwwpstnrates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。