本文整理汇总了Python中djstripe.models.Charge.refunded方法的典型用法代码示例。如果您正苦于以下问题:Python Charge.refunded方法的具体用法?Python Charge.refunded怎么用?Python Charge.refunded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类djstripe.models.Charge
的用法示例。
在下文中一共展示了Charge.refunded方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_str
# 需要导入模块: from djstripe.models import Charge [as 别名]
# 或者: from djstripe.models.Charge import refunded [as 别名]
def test_str(self):
charge = Charge(
amount=50,
currency="usd",
id="ch_test",
status=ChargeStatus.failed,
captured=False,
paid=False,
)
self.assertEqual(str(charge), "$50.00 USD (Uncaptured)")
charge.captured = True
self.assertEqual(str(charge), "$50.00 USD (Failed)")
charge.status = ChargeStatus.succeeded
charge.dispute = Dispute()
self.assertEqual(str(charge), "$50.00 USD (Disputed)")
charge.dispute = None
charge.refunded = True
charge.amount_refunded = 50
self.assertEqual(str(charge), "$50.00 USD (Refunded)")
charge.refunded = False
self.assertEqual(str(charge), "$50.00 USD (Partially refunded)")
charge.amount_refunded = 0
self.assertEqual(str(charge), "$50.00 USD")