Custom payment module

1 view
Skip to first unread message

Alessandro

unread,
Oct 4, 2008, 6:31:25 AM10/4/08
to Satchmo users
I want to add some custom payment modules (I am thinking to provide
them to the community too).

I've copied the dummy from satchmo to myproject.payment.modules.postepay

I've added myproject.payment to INSTALLED APPS
I've added the module to local_settings.py as:
'CUSTOM_PAYMENT_MODULES' : ['myproject.payment.modules.postepay'],

but I still doesn't see the module on the list of payment modules on settings.

What's wrong?
--
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net

SOASI Soc.Coop. - www.soasi.com
Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
Tel.: +39 0543 798985 - Fax: +39 0543 579928

Rispetta l'ambiente: se non ti è necessario, non stampare questa mail

Chris Moffitt

unread,
Oct 4, 2008, 10:17:44 AM10/4/08
to satchm...@googlegroups.com
It sounds like you've done the right things. I'd recommend taking a look at your log file and see if there are any errors. If I recall correctly, there is logging around loading payments so it should tell you that there's a problem.

If there's nothing there, try posting some of the config code to dpaste and we'll take a look.

-Chris

Alessandro

unread,
Oct 7, 2008, 10:19:44 AM10/7/08
to satchm...@googlegroups.com
2008/10/4 Alessandro Ronchi <alessand...@soasi.com>:
> 2008/10/4 Chris Moffitt <ch...@moffitts.net>:

>> It sounds like you've done the right things. I'd recommend taking a look at
>> your log file and see if there are any errors. I

I solved my problem.

I am working to a custom bank payment module.

The only thing I need is to show some configuration values to the user
, like one does for a bank money order (I must show him my bank
details to let him do it's payment outside the site), and send him
that values by email.

is it possible to print the values of config_register_list in templates?
I need only to access to
config = config_get_group('PAYMENT_POSTEPAY')
inside my confirm.html custom template.

And can I customize the email of the order to send the user my
configuration values?

--
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net

Rispetta l'ambiente: se non ti è necessario, non stampare questa mail

Günter Walser

unread,
Oct 7, 2008, 3:42:15 PM10/7/08
to satchm...@googlegroups.com
> is it possible to print the values of config_register_list in templates?
> I need only to access to
> config = config_get_group('PAYMENT_POSTEPAY')
> inside my confirm.html custom template.

Yes, just store the value in the context before rendering the confirm.html
template.

Im my version, which is a very old one so 'm not sure if the code
is still the same, it would look like:

base_env = {
'PAYMENT_LIVE' : payment_live(payment_module),
'default_view_tax' : default_view_tax,
'ronchi-value' : some value out of config, <<<----- your
data
'order': orderToProcess,
'errors': errors,
'checkout_step2': lookup_url(payment_module,
'satchmo_checkout-step2')}
if extra_context:
base_env.update(extra_context)
context = RequestContext(request, base_env)
return render_to_response(template, context)

> And can I customize the email of the order to send the
user my configuration values?

Yes, simply extend the context of the mail rendering, see an example at
http://dpaste.com/83018/. There the shop name is put into context and used
in the rendering process.

Ginta

Alessandro

unread,
Oct 10, 2008, 11:48:21 AM10/10/08
to satchm...@googlegroups.com
2008/10/7 Günter Walser <guenter...@wanagu.eu>:

> Yes, just store the value in the context before rendering the confirm.html
> template.

I have managed to patch the credit_confirm_info for my needs, I thinks
it's a generic useful mod:
~~~~~~~~~~~~~~~~~~~~~~~~~~
controller = ConfirmController(request, payment_module)
if template:
controller.templates['CONFIRM'] = template

# Get group of configuration settings for payment_module
config_group = config_get_group(payment_module)

if config_group:
controller.extraContext['config'] = config_group

controller.confirm()
return controller.response
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So in your template you can print details of the payment configuration, like:

{{config.CCNUMBER}}
or
{{config.CARDOWNER}}


I've posted it here:

http://www.satchmoproject.com/trac/ticket/625


--
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net

SOASI Soc.Coop. - www.soasi.com


Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
Tel.: +39 0543 798985 - Fax: +39 0543 579928

Rispetta l'ambiente: se non ti è necessario, non stampare questa mail

Reply all
Reply to author
Forward
0 new messages