本文整理汇总了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
示例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
示例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
示例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()
示例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)