+ 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)