Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #406 from edx/multi-tenancy/update-receipt-page
Browse files Browse the repository at this point in the history
WAIT-LMS: Using order number for receipt page
  • Loading branch information
clintonb committed Nov 3, 2015
2 parents c008efa + 80907fe commit 0fcdfc7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ecommerce/extensions/checkout/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def send_course_purchase_email(sender, order=None, **kwargs): # pylint: disable
{
'course_title': product.title,
'receipt_page_url': get_lms_url(
'/commerce/checkout/receipt/?basket_id={}'.format(order.basket.id)
'/commerce/checkout/receipt/?orderNum={}'.format(order.number)
),
'credit_hours': product.attr.credit_hours,
'credit_provider': provider_data['display_name'],
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/extensions/checkout/tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ def test_post_checkout_callback(self):
credit_hours=2,
credit_provider='Hogwarts',
platform_name=settings.PLATFORM_NAME,
receipt_url=get_lms_url('/commerce/checkout/receipt/?basket_id={}'.format(order.basket.id))
receipt_url=get_lms_url('/commerce/checkout/receipt/?orderNum={}'.format(order.number))
)
)
2 changes: 1 addition & 1 deletion ecommerce/extensions/payment/processors/cybersource.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_transaction_parameters(self, basket, request=None):
u'currency': basket.currency,
u'consumer_id': basket.owner.username,
# TODO: Update once LMS receipt page is able to look up orders by order number.
u'override_custom_receipt_page': u'{}?basket_id={}'.format(self.receipt_page_url, basket.id),
u'override_custom_receipt_page': u'{}?orderNum={}'.format(self.receipt_page_url, basket.order_number),
u'override_custom_cancel_page': self.cancel_page_url,
}

Expand Down
3 changes: 2 additions & 1 deletion ecommerce/extensions/payment/tests/test_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def test_get_transaction_parameters(self):
u'amount': unicode(self.basket.total_incl_tax),
u'currency': self.basket.currency,
u'consumer_id': self.basket.owner.username,
u'override_custom_receipt_page': u'{}?basket_id={}'.format(self.processor.receipt_page_url, self.basket.id),
u'override_custom_receipt_page': u'{}?orderNum={}'.format(self.processor.receipt_page_url,
self.basket.order_number),
u'override_custom_cancel_page': self.processor.cancel_page_url,
u'merchant_defined_data1': self.course.id,
u'merchant_defined_data2': self.CERTIFICATE_TYPE,
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/extensions/payment/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def _assert_execution_redirect(self, payer_info=None):
response = self.client.get(reverse('paypal_execute'), self.RETURN_DATA)
self.assertRedirects(
response,
u'{}?basket_id={}'.format(self.processor.receipt_url, self.basket.id),
u'{}?orderNum={}'.format(self.processor.receipt_url, self.basket.order_number),
fetch_redirect_response=False
)

Expand Down
2 changes: 1 addition & 1 deletion ecommerce/extensions/payment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get(self, request):

paypal_response = request.GET.dict()
basket = self._get_basket(payment_id)
receipt_url = u'{}?basket_id={}'.format(self.payment_processor.receipt_url, basket.id)
receipt_url = u'{}?orderNum={}'.format(self.payment_processor.receipt_url, basket.order_number)

try:
with transaction.atomic():
Expand Down

0 comments on commit 0fcdfc7

Please sign in to comment.