How to use the recurly.js.sign 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 / test_js.py View on Github external
def test_sign(self):
        self.assertTrue(re.search('nonce=', recurly.js.sign()))
        self.assertTrue(re.search('timestamp=', recurly.js.sign()))
        self.assertEqual(
            recurly.js.sign({'timestamp': 1312701386, 'nonce': 1}),
            '015662c92688f387159bcac9bc1fb250a1327886|nonce=1&timestamp=1312701386'
        )
        self.assertEqual(
            recurly.js.sign(recurly.Account(account_code='1'), {'timestamp': 1312701386, 'nonce': 1}),
            '82bcbbd4deb8b1b663b7407d9085dc67e2922df7|account%5Baccount_code%5D=1&nonce=1&timestamp=1312701386'
        )
github recurly / recurly-client-python / tests / test_js.py View on Github external
def test_sign(self):
        self.assertTrue(re.search('nonce=', recurly.js.sign()))
        self.assertTrue(re.search('timestamp=', recurly.js.sign()))
        self.assertEqual(
            recurly.js.sign({'timestamp': 1312701386, 'nonce': 1}),
            '015662c92688f387159bcac9bc1fb250a1327886|nonce=1&timestamp=1312701386'
        )
        self.assertEqual(
            recurly.js.sign(recurly.Account(account_code='1'), {'timestamp': 1312701386, 'nonce': 1}),
            '82bcbbd4deb8b1b663b7407d9085dc67e2922df7|account%5Baccount_code%5D=1&nonce=1&timestamp=1312701386'
        )
github recurly / recurly-client-python / tests / test_js.py View on Github external
def test_sign(self):
        self.assertTrue(re.search('nonce=', recurly.js.sign()))
        self.assertTrue(re.search('timestamp=', recurly.js.sign()))
        self.assertEqual(
            recurly.js.sign({'timestamp': 1312701386, 'nonce': 1}),
            '015662c92688f387159bcac9bc1fb250a1327886|nonce=1&timestamp=1312701386'
        )
        self.assertEqual(
            recurly.js.sign(recurly.Account(account_code='1'), {'timestamp': 1312701386, 'nonce': 1}),
            '82bcbbd4deb8b1b663b7407d9085dc67e2922df7|account%5Baccount_code%5D=1&nonce=1&timestamp=1312701386'
        )
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}})