How to use the recurly.API_KEY function in recurly

To help you get started, we’ve selected a few recurly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github recurly / recurly-client-python / tests / recurlytests.py View on Github external
def setUp(self):
        import recurly

        # Mock everything out unless we have an API key.
        try:
            api_key = os.environ['RECURLY_API_KEY']
        except KeyError:
            # Mock everything out.
            recurly.API_KEY = 'apikey'
            self.test_id = 'mock'
        else:
            recurly.API_KEY = api_key
            self.mock_request = self.noop_mock_request
            self.mock_sleep = self.noop_mock_sleep
            self.test_id = datetime.now().strftime('%Y%m%d%H%M%S')

        # Update our endpoint if we have a different test host.
        try:
            recurly_host = os.environ['RECURLY_HOST']
        except KeyError:
            pass
        else:
            recurly.BASE_URI = 'https://%s/v2/' % recurly_host

        logging.basicConfig(level=logging.INFO)
        logging.getLogger('recurly').setLevel(logging.DEBUG)
github recurly / recurly-client-python / tests / recurlytests.py View on Github external
def setUp(self):
        import recurly

        # Mock everything out unless we have an API key.
        try:
            api_key = os.environ['RECURLY_API_KEY']
        except KeyError:
            # Mock everything out.
            recurly.API_KEY = 'apikey'
            self.test_id = 'mock'
        else:
            recurly.API_KEY = api_key
            self.mock_request = self.noop_mock_request
            self.mock_sleep = self.noop_mock_sleep
            self.test_id = datetime.now().strftime('%Y%m%d%H%M%S')

        # Update our endpoint if we have a different test host.
        try:
            recurly_host = os.environ['RECURLY_HOST']
        except KeyError:
            pass
        else:
            recurly.BASE_URI = 'https://%s/v2/' % recurly_host

        logging.basicConfig(level=logging.INFO)
github lamby / django-recurly / django_recurly / models.py View on Github external
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
github innocenceproject / collective.salesforce.fundraising / collective / salesforce / fundraising / recurly / views.py View on Github external
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}})
github plecto / motorway / motorway / contrib / recurly_integration / ramps.py View on Github external
def recurly(self):
        import recurly
        recurly.SUBDOMAIN = os.environ.get('RECURLY_SUBDOMAIN')
        recurly.API_KEY = os.environ.get('RECURLY_API_KEY')
        return recurly