Files
edx-platform/lms/djangoapps/shoppingcart/processors/helpers.py
Will Daly 1ad8d4f2d4 Add verification for CyberSource2 implementation.
Clean up shopping cart processor API.
Fix UUID JSON serialization bug in CyberSource2 implementation.
Update test suite to use new CyberSource2 implementation.
Fix i18n messages in CyberSource2
Enable CyberSource2 implementation by default.
2014-08-20 10:39:48 -04:00

32 lines
1.0 KiB
Python

"""
Helper methods for credit card processing modules.
These methods should be shared among all processor implementations,
but should NOT be imported by modules outside this package.
"""
from django.conf import settings
from microsite_configuration import microsite
def get_processor_config():
"""
Return a dictionary of configuration settings for the active credit card processor.
If we're in a microsite and overrides are available, return those instead.
Returns:
dict
"""
# Retrieve the configuration settings for the active credit card processor
config = settings.CC_PROCESSOR.get(
settings.CC_PROCESSOR_NAME, {}
)
# Check whether we're in a microsite that overrides our configuration
# If so, find the microsite-specific configuration in the 'microsites'
# sub-key of the normal processor configuration.
config_key = microsite.get_value('cybersource_config_key')
if config_key:
config = config['microsites'][config_key]
return config