Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
super(TestJs, self).setUp()
recurly.js.PRIVATE_KEY = '0cc86846024a4c95a5dfd3111a532d13'
import recurly
from django.conf import settings
recurly.API_KEY = settings.RECURLY_API_KEY
if hasattr(settings, 'RECURLY_JS_PRIVATE_KEY'):
recurly.js.PRIVATE_KEY = settings.RECURLY_JS_PRIVATE_KEY
def generate_signature(self):
# workaround for http://bugs.python.org/issue5285, map unicode to strings
settings = get_settings()
recurly.API_KEY = str(settings.recurly_api_key)
recurly.js.PRIVATE_KEY = str(settings.recurly_private_key)
plan_code = str(settings.recurly_plan_code)
# Set a default currency for your API requests
recurly.DEFAULT_CURRENCY = 'USD'
return recurly.js.sign({'subscription': {'plan_code': plan_code}})