trying to use cartridge-payments

200 views
Skip to first unread message

jarosl...@gmail.com

unread,
Jan 21, 2014, 5:00:55 PM1/21/14
to mezzani...@googlegroups.com
I am trying to use cartridge-payments
Have pip installed inside virtualenv
added settings to settings.py
but when I am going to checkout I am getting following error:
OperationalError at /shop/checkout/
no such column: shop_order.callback_uuid

wondering how to fix it?

Regards

Jaroslaw

Josh B

unread,
Jan 21, 2014, 5:24:51 PM1/21/14
to mezzani...@googlegroups.com
Did you add this to your settings.py?
EXTRA_MODEL_FIELDS = (
    # ...
    (
        "cartridge.shop.models.Order.callback_uuid",
        "django.db.models.CharField",
        (),
        {"blank" : False, "max_length" : 36},
    ),
    # ...
)
If so did you run python manage.py migrate

Jaroslaw Boss

unread,
Jan 21, 2014, 6:03:49 PM1/21/14
to mezzani...@googlegroups.com

Yes I did

Jaroslaw Boss

unread,
Jan 21, 2014, 6:30:47 PM1/21/14
to mezzani...@googlegroups.com

Here my settings:

from __future__ import absolute_import, unicode_literals

SHOP_CHECKOUT_FORM_CLASS = 'payments.multipayments.forms.base.CallbackUUIDOrderForm'


SHOP_CHECKOUT_STEPS_SPLIT = True

SHOP_CURRENCY_LOCALE = "en_GB"




EXTRA_MODEL_FIELDS = (
    
    (
        "cartridge.shop.models.Order.callback_uuid",
        "django.db.models.CharField",
        (),
        {"blank" : False, "max_length" : 36},
    ),

)


USE_SOUTH = True



ADMINS = (
    # ('Your Name', 'your_...@domain.com'),
)
MANAGERS = ADMINS


ALLOWED_HOSTS = []


TIME_ZONE = None




LANGUAGE_CODE = "en"

_ = lambda s: s
LANGUAGES = (
    ('en', _('English')),
)


DEBUG = False


SESSION_EXPIRE_AT_BROWSER_CLOSE = True

SITE_ID = 1


USE_I18N = False


INTERNAL_IPS = ("127.0.0.1",)


TEMPLATE_LOADERS = (
    "django.template.loaders.filesystem.Loader",
    "django.template.loaders.app_directories.Loader",
)

AUTHENTICATION_BACKENDS = ("mezzanine.core.auth_backends.MezzanineBackend",)


STATICFILES_FINDERS = (
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)


FILE_UPLOAD_PERMISSIONS = 0o644


#############
# DATABASES #
#############

DATABASES = {
    "default": {
        # Add "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
        "ENGINE": "django.db.backends.",
        # DB name or path to database file if using sqlite3.
        "NAME": "",
        # Not used with sqlite3.
        "USER": "",
        # Not used with sqlite3.
        "PASSWORD": "",
        # Set to empty string for localhost. Not used with sqlite3.
        "HOST": "",
        # Set to empty string for default. Not used with sqlite3.
        "PORT": "",
    }
}


#########
# PATHS #
#########

import os

# Full filesystem path to the project.
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))

# Name of the directory for the project.
PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]


CACHE_MIDDLEWARE_KEY_PREFIX = PROJECT_DIRNAME

# URL prefix for static files.
STATIC_URL = "/static/"


STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL.strip("/"))


MEDIA_URL = STATIC_URL + "media/"

MEDIA_ROOT = os.path.join(PROJECT_ROOT, *MEDIA_URL.strip("/").split("/"))


ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME


TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, "templates"),)


################
# APPLICATIONS #
################

INSTALLED_APPS = (
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.redirects",
    "django.contrib.sessions",
    "django.contrib.sites",
    "django.contrib.sitemaps",
    "django.contrib.staticfiles",
    "cartridge.shop",
    "mezzanine.boot",
    "mezzanine.conf",
    "mezzanine.core",
    "mezzanine.generic",
    "mezzanine.blog",
    "mezzanine.forms",
    "mezzanine.pages",
    "mezzanine.galleries",
    #"mezzanine.twitter",
    "mezzanine.accounts",
    #"mezzanine.mobile",
    "payments.multipayments",
    "south",
)


TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.contrib.messages.context_processors.messages",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.static",
    "django.core.context_processors.media",
    "django.core.context_processors.request",
    "mezzanine.conf.context_processors.settings",
    "payments.multipayments.context_processors.settings",
)


MIDDLEWARE_CLASSES = (
    "mezzanine.core.middleware.UpdateCacheMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.locale.LocaleMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.redirects.middleware.RedirectFallbackMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "cartridge.shop.middleware.ShopMiddleware",
    "mezzanine.core.request.CurrentRequestMiddleware",
    "mezzanine.core.middleware.TemplateForDeviceMiddleware",
    "mezzanine.core.middleware.TemplateForHostMiddleware",
    "mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware",
    "mezzanine.core.middleware.SitePermissionMiddleware",
    # Uncomment the following if using any of the SSL settings:
    # "mezzanine.core.middleware.SSLRedirectMiddleware",
    "mezzanine.pages.middleware.PageMiddleware",
    "mezzanine.core.middleware.FetchFromCacheMiddleware",
)

# Store these package names here as they may change in the future since
# at the moment we are using custom forks of them.
PACKAGE_NAME_FILEBROWSER = "filebrowser_safe"
PACKAGE_NAME_GRAPPELLI = "grappelli_safe"


OPTIONAL_APPS = (
    "debug_toolbar",
    "django_extensions",
    "compressor",
    PACKAGE_NAME_FILEBROWSER,
    PACKAGE_NAME_GRAPPELLI,
)

DEBUG_TOOLBAR_CONFIG = {"INTERCEPT_REDIRECTS": False}


try:
    from local_settings import *
except ImportError:
    pass



try:
    from mezzanine.utils.conf import set_dynamic_settings
except ImportError:
    pass
else:
    set_dynamic_settings(globals())

                      


PRIMARY_PAYMENT_PROCESSOR_IN_USE = True

                      

# These processors are forms to submit to remote URLs for processing.
SECONDARY_PAYMENT_PROCESSORS = (
    #...
    ('paypal', {
        'name' : 'Pay With Pay-Pal',
        'form' : 'payments.multipayments.forms.paypal.PaypalSubmissionForm'
    }),
    # ...
    ('google', {
        'name' : 'Pay With Google Wallet',
        'form' : 'payments.multipayments.forms.google.GoogleSubmissionForm'
    })
    # ...
)

                      

# Currency type.
PAYPAL_CURRENCY = "USD"

                      

# Business account email. Sandbox emails look like this.
PAYPAL_BUSINESS = 'seller_XX...@example.com'

                      

# Use this to enable https on return URLs.  This is strongly recommended! (Except for sandbox)
PAYPAL_RETURN_WITH_HTTPS = True

                      


PAYPAL_RETURN_URL = lambda cart, uuid, order_form: ('shop_complete', None, None)

                      


PAYPAL_IPN_URL = lambda cart, uuid, order_form: ('my_paypal_ipn', None, {'uuid' : uuid})

                      

# URL the secondary-payment-form is submitted to
# Dev example
# Prod example

                      

#goolgiel

                      

# URL the secondary-payment-form is submitted to
# Dev example
GOOGLE_CHECKOUT_SUBMIT_URL = \
# Prod example
#GOOGLE_CHECKOUT_SUBMIT_URL = \

Jaroslaw Boss

unread,
Jan 22, 2014, 5:12:52 AM1/22/14
to mezzani...@googlegroups.com
My pip freeze:

Cartridge==0.9.2
Django==1.6.1
Mezzanine==3.0.6
Pillow==2.3.0
South==0.8.4
bleach==1.4
cartridge-payments==0.97.0
filebrowser-safe==0.3.1
future==0.9.0
grappelli-safe==0.3.4
html5lib==0.999
oauthlib==0.6.1
pisa==3.0.33
pytz==2013.9
requests==2.2.0
requests-oauthlib==0.4.0
six==1.5.2
tzlocal==1.0
wsgiref==0.1.2

I have installed in order:

pip install south
pip install -U cartridge
pip install cartridge-payments
then

mezzanine-project -a cartridge project_name
cd project_name
./manage.py createdb —noinput

./manage.py runserver

Then after checking if works ctrl c and have edited settings.py
./manage.py syncdb
./manage.py migrate
./manage.py runserver

Is it a correct way or I am doing something wrong?

Regards

Jaroslaw

jarosl...@gmail.com

unread,
Jan 23, 2014, 2:26:12 PM1/23/14
to mezzani...@googlegroups.com
After many many tries I am still getting same error

Can anyone help?

Luc Milland

unread,
Jan 23, 2014, 2:32:04 PM1/23/14
to mezzani...@googlegroups.com
Hello,
does the column exist in the database or not ?
Message suggest it does not, but did you check it ? If not, I guess
something went wrong with the migration.

Luc

Le jeudi 23 janvier 2014 à 11:26 -0800, jarosl...@gmail.com a
écrit :

Jaroslaw Boss

unread,
Jan 23, 2014, 2:44:57 PM1/23/14
to mezzani...@googlegroups.com
Hi Luc ,

Thanks for your help

I have checked it It does not exist in database.

I’ve found another thing…
This time I have installed everything in new envelope and instead of doing createdb --noinput
after mezzanine-project -a cartridge project_name
I have added payment settings to settings.py and then did run createdb —noinput
now what i have is the the regular /shop/checkout/
Changing strings like SHOP_CHECKOUT_STEPS_SPLIT = True
does have effect but still I can’t see my payments with its google wallet / paypal options
There must be something wrong with adding things to database


Regards

Jaroslaw
> --
> You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/74fj6_KXAFE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Jaroslaw Boss

unread,
Jan 23, 2014, 3:30:43 PM1/23/14
to mezzani...@googlegroups.com

On 23 Jan 2014, at 20:44, Jaroslaw Boss <jarosl...@gmail.com> wrote:

strings

supposed to be settings


Luc Milland

unread,
Jan 24, 2014, 2:17:26 AM1/24/14
to mezzani...@googlegroups.com
Hi,

> I have checked it It does not exist in database.
As I can recall, the only thing I did to create it in database in the
site I am building now, is what Josh B wrote :
- adding the EXTRA_MODEL_FIELDS definition for callback_uuid
- running schemamigration in the way Stephen advices here :
http://mezzanine.jupo.org/docs/model-customization.html#field-injection-caveats
- running python manage.py migrate myapp

>
> I've found another thing...
> This time I have installed everything in new envelope and instead of doing createdb --noinput
> after mezzanine-project -a cartridge project_name
> I have added payment settings to settings.py and then did run createdb --noinput
> now what i have is the the regular /shop/checkout/
so the column exists this time, right ?

> Changing strings like SHOP_CHECKOUT_STEPS_SPLIT = True
> does have effect but still I can't see my payments with its google wallet / paypal options
> There must be something wrong with adding things to database
I dont think this is database related, you should check your
configuration, form and templates.

regards,
Luc

Jaroslaw Boss

unread,
Jan 24, 2014, 6:54:14 AM1/24/14
to mezzani...@googlegroups.com
It works !

> so the column exists this time, right ?

Yes this time it does exist
>> Changing strings like SHOP_CHECKOUT_STEPS_SPLIT = True
>> does have effect but still I can't see my payments with its google wallet / paypal options
>> There must be something wrong with adding things to database
> I dont think this is database related, you should check your
> configuration, form and templates.


Yes I have copied payment.html and payment_fields.html
from
site-packages/payments/multipayments/templates/shop/
To

site-packages/cartridge/shop/templates/shop
And now I can see payment alternatives.

Thank You !

Regards

Jaroslaw


Reply all
Reply to author
Forward
0 new messages