Merge pull request #8771 from edx/clintonb/currency-comparison-fix

Comparing currencies with same case
This commit is contained in:
Clinton Blackburn
2015-07-09 01:45:39 -04:00
4 changed files with 18 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ class CourseApiViewTestMixin(object):
""" Serialize a CourseMode to a dict. """
return {
u'name': course_mode.mode_slug,
u'currency': course_mode.currency,
u'currency': course_mode.currency.lower(),
u'price': course_mode.min_price,
u'sku': course_mode.sku
}

View File

@@ -357,7 +357,7 @@ def _payment_accepted(order_id, auth_amount, currency, decision):
raise CCProcessorDataException(_("The payment processor accepted an order whose number is not in our system."))
if decision == 'ACCEPT':
if auth_amount == order.total_cost and currency == order.currency:
if auth_amount == order.total_cost and currency.lower() == order.currency.lower():
return {
'accepted': True,
'amt_charged': auth_amount,