Commit 13e80d5a by Clinton Blackburn

Merge pull request #124 from edx/coverage-update

Boosted Code Coverage
parents 0f35b042 f1bfd99b
...@@ -8,3 +8,5 @@ omit = ecommerce/settings* ...@@ -8,3 +8,5 @@ omit = ecommerce/settings*
*test* *test*
*static* *static*
*templates* *templates*
ecommerce/extensions/checkout/apps.py
ecommerce/extensions/dashboard/refunds/config.py
...@@ -15,34 +15,6 @@ class Order(AbstractOrder): ...@@ -15,34 +15,6 @@ class Order(AbstractOrder):
""" Returns a boolean indicating if order is eligible to retry fulfillment. """ """ Returns a boolean indicating if order is eligible to retry fulfillment. """
return self.status == ORDER.FULFILLMENT_ERROR return self.status == ORDER.FULFILLMENT_ERROR
@classmethod
def check_order_total(cls, order_num, auth_amount, auth_currency):
"""
Verify that the auth amount given matches the total price of an order and that the currencies
are also correct.
Args:
order_num (str): order number for the given order
auth_amount (Decimal): the amount that we would like to verify is correct
auth_currency (str): the currency of the amount we'd like to verify is correct
Returns:
True if the amount and currency matches
False otherwise
Raises:
DoesNotExist: if there is no order that matches the number given
"""
order = Order.objects.get(number=order_num)
if order.total_excl_tax == auth_amount and order.currency == auth_currency:
return True
else:
# Set the status to indicate that there was an error.
order.set_status(ORDER.PAYMENT_ERROR)
return False
class PaymentEvent(AbstractPaymentEvent): class PaymentEvent(AbstractPaymentEvent):
processor_name = models.CharField(_("Payment Processor"), max_length=32, blank=True, null=True) processor_name = models.CharField(_("Payment Processor"), max_length=32, blank=True, null=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment