@login_required
def show_receipt(request, ordernum):
 try:
  order = Order.objects.get(id=ordernum)
 except Order.DoesNotExist:
  raise Http404('Order not found!')
 if ((order.user != request.user) or (order.status not in ['purchased', 'refunded'])):
  raise Http404('Order not found!')
 if ('application/json' in request.META.get('HTTP_ACCEPT', '')):
  return _show_receipt_json(order)
 else:
  return _show_receipt_html(request, order)

@ login_required def show_receipt ( request , ordernum ) : try : order = Order . objects . get ( id = ordernum ) except Order . DoesNotExist : raise Http404 ( 'Order not found!' ) if ( ( order . user != request . user ) or ( order . status not in [ 'purchased' , 'refunded' ] ) ) : raise Http404 ( 'Order not found!' ) if ( 'application/json' in request . META . get ( 'HTTP_ACCEPT' , '' ) ) : return _show_receipt_json ( order ) else : return _show_receipt_html ( request , order )
displays a receipt for a particular order .