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


Python CreditProvider.get_provider_by_provider_id方法代码示例

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


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

示例1: _ensure_card_providers

# 需要导入模块: from stoqlib.domain.payment.card import CreditProvider [as 别名]
# 或者: from stoqlib.domain.payment.card.CreditProvider import get_provider_by_provider_id [as 别名]
def _ensure_card_providers():
    """ Creates a list of default card providers """
    log.info("Creating Card Providers")
    from stoqlib.domain.payment.card import CreditProvider, CardPaymentDevice

    providers = [u"VISANET", u"REDECARD", u"AMEX", u"HIPERCARD", u"BANRISUL", u"PAGGO", u"CREDISHOP", u"CERTIF"]

    store = new_store()
    for name in providers:
        provider = CreditProvider.get_provider_by_provider_id(name, store)
        if not provider.is_empty():
            continue

        CreditProvider(short_name=name, provider_id=name, open_contract_date=TransactionTimestamp(), store=store)
    devices = store.find(CardPaymentDevice)
    if devices.is_empty():
        CardPaymentDevice(store=store, description=_(u"Default"))
    store.commit(close=True)
开发者ID:stoq,项目名称:stoq,代码行数:20,代码来源:admin.py

示例2: _ensure_card_providers

# 需要导入模块: from stoqlib.domain.payment.card import CreditProvider [as 别名]
# 或者: from stoqlib.domain.payment.card.CreditProvider import get_provider_by_provider_id [as 别名]
def _ensure_card_providers():
    """ Creates a list of default card providers """
    log.info("Creating Card Providers")
    from stoqlib.domain.payment.card import CreditProvider

    providers = [u'VISANET', u'REDECARD', u'AMEX', u'HIPERCARD',
                 u'BANRISUL', u'PAGGO', u'CREDISHOP', u'CERTIF']

    store = new_store()
    for name in providers:
        provider = CreditProvider.get_provider_by_provider_id(name, store)
        if not provider.is_empty():
            continue

        CreditProvider(short_name=name,
                       provider_id=name,
                       open_contract_date=TransactionTimestamp(),
                       store=store)
    store.commit(close=True)
开发者ID:romaia,项目名称:stoq,代码行数:21,代码来源:admin.py

示例3: _ensure_card_providers

# 需要导入模块: from stoqlib.domain.payment.card import CreditProvider [as 别名]
# 或者: from stoqlib.domain.payment.card.CreditProvider import get_provider_by_provider_id [as 别名]
def _ensure_card_providers():
    """ Creates a list of default card providers """
    log.info("Creating Card Providers")
    from stoqlib.domain.payment.card import CreditProvider, CardPaymentDevice

    providers = {u'VISA': u'VISA',
                 u'MASTER': u'MASTER',
                 u'AMEX': u'AMEX'}
    store = new_store()
    for short_name, provider_id in providers.items():
        provider = CreditProvider.get_provider_by_provider_id(provider_id, store)
        if not provider.is_empty():
            continue

        CreditProvider(short_name=short_name,
                       provider_id=providers[short_name],
                       open_contract_date=TransactionTimestamp(),
                       store=store)
    devices = store.find(CardPaymentDevice)
    if devices.is_empty():
        CardPaymentDevice(store=store, description=_(u'Default'))
    store.commit(close=True)
开发者ID:hackedbellini,项目名称:stoq,代码行数:24,代码来源:admin.py

示例4: test_get_provider_by_id

# 需要导入模块: from stoqlib.domain.payment.card import CreditProvider [as 别名]
# 或者: from stoqlib.domain.payment.card.CreditProvider import get_provider_by_provider_id [as 别名]
    def test_get_provider_by_id(self):
        provider = self.create_credit_provider()
        provider.provider_id = u'foo'

        obj = CreditProvider.get_provider_by_provider_id(u'foo', self.store)
        self.assertEqual(provider, obj[0])
开发者ID:stoq,项目名称:stoq,代码行数:8,代码来源:test_card.py


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