code: def dispatch(self,request,*args,**kwargs):
          '''
          Check that a valid Invoice ID has been passed in session data,
          and that said invoice is marked as paid.
          '''
          paymentSession = request.session.get(INVOICE_VALIDATION_STR, {})
          self.invoiceID = paymentSession.get('invoiceID')
          self.amount = paymentSession.get('amount',0)
          self.success_url = paymentSession.get('success_url',reverse('registration'))
  
          # Check that Invoice matching passed ID exists
          try:
              i = Invoice.objects.get(id=self.invoiceID)
          except ObjectDoesNotExist:
              return HttpResponseBadRequest(_('Invalid invoice information passed.'))
  
          if i.unpaid or i.amountPaid != self.amount:
              return HttpResponseBadRequest(_('Passed invoice is not paid.'))
  
          return super(GiftCertificateCustomizeView,self).dispatch(request,*args,**kwargsf dispatch(self,request,*args,**kwargs):
          '''
          Check that a valid Invoice ID has been passed in session data,
          and that said invoice is marked as paid.
          '''
          paymentSession = request.session.get(INVOICE_VALIDATION_STR, {})
          self.invoiceID = paymentSession.get('invoiceID')
          self.amount = paymentSession.get('amount',0)
          self.success_url = paymentSession.get('success_url',reverse('registration'))
  
          # Check that Invoice matching passed ID exists
          try:
              i = Invoice.objects.get(id=self.invoiceID)
          except ObjectDoesNotExist:
              return HttpResponseBadRequest(_('Invalid invoice information passed.'))
  
          if i.unpaid or i.amountPaid != self.amount:
              return HttpResponseBadRequest(_('Passed invoice is not paid.'))
  
          return super(GiftCertificateCustomizeView,self).dispatch(request,*args,**kwargs)
docs: Check that a valid Invoice ID has been passed in session data,
          and that said invoice is marked as paid.