本文整理汇总了Python中paypal.standard.ipn.models.PayPalIPN.invoice方法的典型用法代码示例。如果您正苦于以下问题:Python PayPalIPN.invoice方法的具体用法?Python PayPalIPN.invoice怎么用?Python PayPalIPN.invoice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paypal.standard.ipn.models.PayPalIPN
的用法示例。
在下文中一共展示了PayPalIPN.invoice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_handler_sends_email
# 需要导入模块: from paypal.standard.ipn.models import PayPalIPN [as 别名]
# 或者: from paypal.standard.ipn.models.PayPalIPN import invoice [as 别名]
def test_handler_sends_email(self):
ipn = PayPalIPN()
ipn.invoice = str(self.user_order.id)
payment_was_successful.send(sender=ipn)
message = self.email_message % dict(
order_number=self.user_order.id,
total=UserOrder.objects.get(id=self.user_order.id).total,
)
self.__class__.send_mail.assert_called_once_with(
'Your UCBC Order #%d' % self.user_order.id,
message,
settings.ORDER_FROM_EMAIL,
[self.user.email, settings.ORDER_FROM_EMAIL],
fail_silently=True,
auth_user=settings.ORDER_EMAIL_HOST_USER,
auth_password=settings.ORDER_EMAIL_HOST_PASSWORD,
)
示例2: test_payment_was_successful_handler_user_order_doesnt_exist
# 需要导入模块: from paypal.standard.ipn.models import PayPalIPN [as 别名]
# 或者: from paypal.standard.ipn.models.PayPalIPN import invoice [as 别名]
def test_payment_was_successful_handler_user_order_doesnt_exist(self, getLogger):
log = getLogger()
ipn = PayPalIPN()
ipn.invoice = "5"
payment_was_successful.send(sender=ipn)
log.error.assert_called_once_with("No UserOrder with id: %d" % 5)
示例3: test_handler_flags_user_order_as_paid
# 需要导入模块: from paypal.standard.ipn.models import PayPalIPN [as 别名]
# 或者: from paypal.standard.ipn.models.PayPalIPN import invoice [as 别名]
def test_handler_flags_user_order_as_paid(self):
ipn = PayPalIPN()
ipn.invoice = str(self.user_order.id)
payment_was_successful.send(sender=ipn)
self.assert_order_paid()