Skip to content

Instantly share code, notes, and snippets.

@mbrochh
Created June 30, 2011 01:41
Show Gist options
  • Save mbrochh/1055461 to your computer and use it in GitHub Desktop.
Save mbrochh/1055461 to your computer and use it in GitHub Desktop.
SkipShippingBackend
# -*- coding: utf-8 -*-
"""Shipping backend that skips the whole shipping process."""
from django.conf.urls.defaults import patterns, url
class SkipShippingBackend(object):
backend_name = "Skip Shipping Backend"
url_namespace = "skip-shipping"
def __init__(self, shop):
self.shop = shop
def simple_view(self, request):
"""
This simple view does nothing but forward to the final URL. When the
money is sent, the shop owner can set this order to complete manually.
"""
order = self.shop.get_order(request)
return self.shop.finished(order)
def get_urls(self):
urlpatterns = patterns('',
url(r'^$', self.simple_view, name='skip-shipping' ),
)
return urlpatterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment