Creating a new payment module

35 views
Skip to first unread message

Thomas

unread,
Mar 28, 2012, 2:48:00 PM3/28/12
to satchm...@googlegroups.com
Hi,

I've created a simple payment module in src/satchmo/satchmo/apps/payment/modules. It works fine there, but I would rather not have it in the satchmo source tree. How can I get it to function from my 'store' directory? If I move it to store/ or store/localsite/ I get the error "Error: No module named payment.modules.vcs" (My module is called vcs obviously.) I did update settings.py from 'payment.modules.vcs' to 'localsite.payment.modules.vcs' but that didn't help. (I created the structure store/localsite/payment/modules/vcs/...)

Many thanks,
Thomas

lacry...@gmail.com

unread,
Mar 28, 2012, 4:08:26 PM3/28/12
to satchm...@googlegroups.com
Does importing from localsite usually work? Have you tried adding "store." in front? Do the __init__.py files exist in all those directories?


-----Mensaje original-----
De: Thomas
Enviados: 28/03/2012 15:48:00
Asunto: Creating a new payment module

Hi,

Many thanks,
Thomas

--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/satchmo-users/-/l8PaE71DWHYJ.
To post to this group, send email to satchm...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.


Laszlo Antal

unread,
Mar 28, 2012, 4:41:20 PM3/28/12
to satchm...@googlegroups.com, satchm...@googlegroups.com
Hi,

On Mar 28, 2012, at 11:48, Thomas <tea.a...@gmail.com> wrote:

Hi,

I've created a simple payment module in src/satchmo/satchmo/apps/payment/modules. It works fine there, but I would rather not have it in the satchmo source tree. How can I get it to function from my 'store' directory? If I move it to store/ or store/localsite/ I get the error "Error: No module named payment.modules.vcs" (My module is called vcs obviously.) I did update settings.py from 'payment.modules.vcs' to 'localsite.payment.modules.vcs' but that didn't help. (I created the structure store/localsite/payment/modules/vcs/...)


Add it to SATCHMO_SETTINGS dict in your settings.py

LZAntal

Thomas

unread,
Mar 29, 2012, 2:04:37 AM3/29/12
to satchm...@googlegroups.com, lacry...@gmail.com
On Wednesday, March 28, 2012 10:08:26 PM UTC+2, Tomas Neme wrote:
Does importing from localsite usually work? Have you tried adding "store." in front? Do the __init__.py files exist in all those directories? 

Yes. I have a fully functional site with everything under localsite working properly. I also have __init__.py in there (as well as a templatetags directory, etc). If I leave my payment module (vcs) in the satchmo source tree with the other payment modules like authorizenet, then it works perfectly.)

To move my 'vcs' module from the satchmo source tree, I tried this:
  • Created store/localsite/vcs
  • Changed settings.py as follows: payment.modules.vcs became store.localsite.vcs
This is localsite:
 .
├── admin.py
├── contact.py
├── __init__.py
├── models.py
├── templatetags
│   ├── __init__.py
│   └── local_tags.py
├── urls.py
├── vcs
│   ├── config.py
│   ├── __init__.py
│   ├── models.py
│   ├── processor.py
│   ├── urls.py
│   └── views.py
└── views.py

This is settings.py:

INSTALLED_APPS = (
    'store.localsite.vcs',
    ...
)

This is urlpatterns in the urls.py in vcs/

      (r'^confirm/$',  'store.localsite.vcs.views.confirm',  {'SSL':ssl}, 'VCS_satchmo_checkout-step2'),   
     (r'^approved/$', 'store.localsite.vcs.views.approved', {'SSL':ssl}, 'VCS_satchmo_checkout-approved'),
     (r'^declined/$', 'store.localsite.vcs.views.declined', {'SSL':ssl}, 'VCS_satchmo_checkout-declined'),

I've also tried putting vcs into store/ but with similar results.
The current error I'm seeing is "Caught ViewDoesNotExist while rendering: Could not import store.localsite.vcs.views. Error was: No module named vcs.processor"

Thomas

unread,
Mar 29, 2012, 2:07:45 AM3/29/12
to satchm...@googlegroups.com
On Wednesday, March 28, 2012 10:41:20 PM UTC+2, lzantal wrote:

Add it to SATCHMO_SETTINGS dict in your settings.py

LZAntal

Can you be more specific please?  Currently my SATCHMO_SETTINGS looks like this:

SATCHMO_SETTINGS = {
    'SHOP_BASE' : '',
    'MULTISHOP' : False,
}

hynekcer

unread,
Mar 29, 2012, 3:21:19 AM3/29/12
to Satchmo users
LZAntal,
SATCHMO_SETTINGS should be not important. At the beginning of the
file
satchmo/apps/satchmo_store/shop/satchmo_settings.py
you see a list of all settings specific to Satchmo which currently use
SATCHMO_SETTINGS and not livesettings. (I have verified completeness.)

Thomas,
A) you wrote
> Error: No module named payment.modules.vcs

You have forgetten harcoded "payment.modules.vcs" somewhere!
You should see eventually "no ... store.localsite.vcs" in the worst
case only.

Can you import it on the new place?
$ python manage.py shell
>>> import store.localsite.vcs

B) Do you see vcs settings in livesettings?

-- Hy

Thomas

unread,
Mar 29, 2012, 4:02:37 AM3/29/12
to satchm...@googlegroups.com
On Thursday, March 29, 2012 9:21:19 AM UTC+2, hynekcer wrote:

Thomas,
A) you wrote
> Error: No module named payment.modules.vcs

You have forgetten harcoded "payment.modules.vcs" somewhere!
You should see eventually "no ... store.localsite.vcs" in the worst
case only.

Thanks hynekcer - I missed one. That was the solution. It works properly now. 
Reply all
Reply to author
Forward
0 new messages