FirstPost?!?

90 views
Skip to first unread message

Tom Christensen

unread,
Dec 8, 2012, 9:05:24 PM12/8/12
to django-...@googlegroups.com
I'm working on a system where our customers will require the ability to setup *their* gateway accounts in our system to process billing.  So far django-merchant appears to have the best/cleanest interface to multiple gateways, however, because the settings for the gateways are hard coded in the settings (sure I could muck with the settings object on the fly but that feels pretty hackish and I don't know if it will introduce thread safety issues), I can't use multiple gateway accounts simultaneously.  

It appears as though it should be trivial to add the ability in get_gateway() to optionally pass the settings dictionary along with the gateway name, and then it should build the gateway object easily... 

What is the preferred way in the project to pass these arguments? I see in the beanstream gateway that it expects all the args to be passed as kwargs... I was planning on implementing it as a single kwarg settings which would contain the same dictionary that is contained in the settings.py for each gateway... then the __init__ of each gateway can be implemented as gw_name_settings = kwargs.pop('settings', merchant_settings['gw_name'])... feels cleaner than having to pop kwargs all over the __init__ and the dictionaries can be completely interchangeable...

I hope to contribute my changes back to the project hence the question.

Thanks,
-Tom

Tom Christensen

unread,
Dec 9, 2012, 12:57:19 AM12/9/12
to django-...@googlegroups.com
After a bit more investigation it seems the other side of the shop (the integrations) do mostly accept an options kwarg that provides the same/similar semantics as I'm proposing for my settings kwarg... options is probably a better fit because it doesn't clash with the existing django settings... 

I'll probably implement it the same way on the gateway side... 
-Tom

Thejaswi Puthraya

unread,
Dec 9, 2012, 11:05:59 PM12/9/12
to django-...@googlegroups.com
Hi Tom,

On Sun, Dec 9, 2012 at 7:35 AM, Tom Christensen <pav...@gmail.com> wrote:

[snipped]
 
What is the preferred way in the project to pass these arguments? I see in the beanstream gateway that it expects all the args to be passed as kwargs... I was planning on implementing it as a single kwarg settings which would contain the same dictionary that is contained in the settings.py for each gateway... then the __init__ of each gateway can be implemented as gw_name_settings = kwargs.pop('settings', merchant_settings['gw_name'])... feels cleaner than having to pop kwargs all over the __init__ and the dictionaries can be completely interchangeable...

Sending the settings object to the gateway sounds fine to me. Looking forward to your pull request.

Linda Patricia

unread,
Mar 18, 2024, 1:28:50 AM3/18/24
to django-merchant
Hello, I need authorize.net account. 
I'm ready to buy or partnership.
Contact me directly.

Thanks




Reply all
Reply to author
Forward
0 new messages