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


Python InvoicePrototype.create方法代码示例

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


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

示例1: setUp

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import create [as 别名]
    def setUp(self):
        super(_BaseBuyPosponedTaskTests, self).setUp()

        create_test_map()

        self.initial_amount = 500
        self.amount = 130

        result, account_id, bundle_id = register_user('test_user', '[email protected]', '111111')
        self.account = AccountPrototype.get_by_id(account_id)

        self.bank_account = BankAccountPrototype.create(entity_type=ENTITY_TYPE.GAME_ACCOUNT,
                                                        entity_id=self.account.id,
                                                        currency=CURRENCY_TYPE.PREMIUM)
        self.bank_account.amount = self.initial_amount
        self.bank_account.save()

        self.invoice = InvoicePrototype.create(recipient_type=ENTITY_TYPE.GAME_ACCOUNT,
                                               recipient_id=self.account.id,
                                               sender_type=ENTITY_TYPE.GAME_LOGIC,
                                               sender_id=0,
                                               currency=CURRENCY_TYPE.PREMIUM,
                                               amount=-self.amount,
                                               description_for_sender='transaction-description-for-sender',
                                               description_for_recipient='transaction-description-for-recipient',
                                               operation_uid='transaction-operation-ui')

        self.transaction = Transaction(self.invoice.id)

        self.task = None
        self.storage = None
        self.cmd_update_with_account_data__call_count = 1
        self.accounts_manages_worker = True
        self.supervisor_worker = False
开发者ID:Alkalit,项目名称:the-tale,代码行数:36,代码来源:base_buy_task.py

示例2: setUp

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import create [as 别名]
    def setUp(self):
        super(_BaseBuyPosponedTaskTests, self).setUp()

        create_test_map()

        self.initial_amount = 500
        self.amount = 130

        self.account = self.accounts_factory.create_account()

        self.bank_account = BankAccountPrototype.create(
            entity_type=ENTITY_TYPE.GAME_ACCOUNT, entity_id=self.account.id, currency=CURRENCY_TYPE.PREMIUM
        )
        self.bank_account.amount = self.initial_amount
        self.bank_account.save()

        self.invoice = InvoicePrototype.create(
            recipient_type=ENTITY_TYPE.GAME_ACCOUNT,
            recipient_id=self.account.id,
            sender_type=ENTITY_TYPE.GAME_LOGIC,
            sender_id=0,
            currency=CURRENCY_TYPE.PREMIUM,
            amount=-self.amount,
            description_for_sender="transaction-description-for-sender",
            description_for_recipient="transaction-description-for-recipient",
            operation_uid="transaction-operation-ui",
        )

        self.transaction = Transaction(self.invoice.id)

        self.task = None
        self.storage = None
        self.cmd_update_with_account_data__call_count = 1
        self.accounts_manages_worker = True
        self.supervisor_worker = False
开发者ID:Tiendil,项目名称:the-tale,代码行数:37,代码来源:base_buy_task.py

示例3: create_invoice

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import create [as 别名]
    def create_invoice(self,
                       recipient_type=ENTITY_TYPE.GAME_ACCOUNT,
                       recipient_id=3,
                       sender_type=ENTITY_TYPE.GAME_LOGIC,
                       sender_id=8,
                       currency=CURRENCY_TYPE.PREMIUM,
                       amount=317,
                       state=None,
                       description_for_sender='invoice-description-for-sender',
                       description_for_recipient='invoice-description-for-recipient',
                       operation_uid='test-uid',
                       force=False):
        invoice = InvoicePrototype.create(recipient_type=recipient_type,
                                          recipient_id=recipient_id,
                                          sender_type=sender_type,
                                          sender_id=sender_id,
                                          currency=currency,
                                          amount=amount,
                                          description_for_sender=description_for_sender,
                                          description_for_recipient=description_for_recipient,
                                          operation_uid=operation_uid,
                                          force=force)
        if state is not None:
            invoice.state = state
            invoice.save()

        return invoice
开发者ID:Alkalit,项目名称:the-tale,代码行数:29,代码来源:helpers.py

示例4: _create_outcoming_invoice

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import create [as 别名]
 def _create_outcoming_invoice(self, amount, state=INVOICE_STATE.FROZEN):
     invoice = InvoicePrototype.create(sender_type=self.account.entity_type,
                                       sender_id=self.account.entity_id,
                                       recipient_type=ENTITY_TYPE.GAME_LOGIC,
                                       recipient_id=0,
                                       currency=CURRENCY_TYPE.PREMIUM,
                                       amount=amount,
                                       description_for_sender='outcoming invoice for sender',
                                       description_for_recipient='outcoming invoice for recipient',
                                       operation_uid='outcoming-operation-uid')
     invoice.state = state
     invoice.save()
开发者ID:,项目名称:,代码行数:14,代码来源:

示例5: create

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import create [as 别名]
    def create(cls, recipient_type, recipient_id, sender_type, sender_id, currency, amount, description_for_sender, description_for_recipient, operation_uid, force=False):
        invoice = InvoicePrototype.create(recipient_type=recipient_type,
                                          recipient_id=recipient_id,
                                          sender_type=sender_type,
                                          sender_id=sender_id,
                                          currency=currency,
                                          amount=amount,
                                          description_for_sender=description_for_sender,
                                          description_for_recipient=description_for_recipient,
                                          operation_uid=operation_uid,
                                          force=force)

        environment.workers.bank_processor.cmd_init_invoice()

        return cls(invoice_id=invoice.id)
开发者ID:Alkalit,项目名称:the-tale,代码行数:17,代码来源:transaction.py


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