def finished(self, order): """ A helper for backends, so that they can call this when their job is finished i.e. shipping costs are added to the order. This will redirect to the "select a payment method" page. """ payment_selection.send(self, order=order) # Emit the signal to say we're now selecting payment return redirect('checkout_payment')
def finished(self, order): """ A helper for backends, so that they can call this when their job is finished i.e. shipping costs are added to the order. This will redirect to the "select a payment method" page. """ # Emit the signal to say we're now selecting payment payment_selection.send(self, order=order) return redirect('checkout_payment')
def finished(self, order): """ A helper for backends, so that they can call this when their job is finished i.e. shipping costs are added to the order. This will redirect to the "order confirmation" page. """ order.status = Order.CONFIRMING order.save() # Emit the signal to say we're now selecting payment payment_selection.send(self, order=order) return redirect('checkout_confirm')
def get_context_data(self, **kwargs): """ This overrides the context from the normal template view """ ctx = super(SelectPaymentView, self).get_context_data(**kwargs) # Set the order status: order = get_order_from_request(self.request) order.status = Order.PAYMENT payment_selection.send(sender=self, order=order) payment_modules_list = backends_pool.get_payment_backends_list() select = {} for backend in payment_modules_list: url = reverse(backend.url_namespace) select.update({backend.backend_name: url}) ctx.update({"payment_options": select}) return ctx