+ funding = form.save()
+ # Skip getpaid.forms.PaymentMethodForm, go directly to the broker.
+ payment = Payment.create(funding, self.backend)
+ gateway_url_tuple = payment.get_processor()(payment).get_gateway_url(self.request)
+ payment.change_status('in_progress')
+ return redirect(gateway_url_tuple[0])
+
+
+class CurrentView(OfferDetailView):
+ @csrf_exempt
+ def dispatch(self, request, slug=None):
+ self.object = Offer.current()
+ if self.object is None:
+ raise Http404
+ elif slug != self.object.slug:
+ return redirect(reverse('funding_current', args=[self.object.slug]))
+ return super(CurrentView, self).dispatch(request, slug)
+
+
+class OfferListView(ListView):
+ queryset = Offer.public()
+
+ def get_context_data(self, *args, **kwargs):
+ ctx = super(OfferListView, self).get_context_data(*args, **kwargs)
+ ctx['funding_no_show_current'] = True
+ return ctx