Ejemplo n.º 1
0
    def handle(self, *args, **options):

        if options['accounts']:
            for account in recurly.Account.all_active():
                print(dump(account))
        elif options['account']:
            account = recurly.Account.get(options['account'])
            print(dump(account))

        elif options['subscriptions']:
            for subscription in recurly.Subscription.all():
                print(dump(subscription))
        elif options['subscription']:
            subscription = recurly.Subscription.get(options['subscription'])
            print(dump(subscription))

        elif options['plans']:
            for plan in recurly.Plan.all():
                print(dump(plan))
        elif options['plan']:
            plan = recurly.Plan.get(options['plan'])
            print(dump(plan))

        else:
            self.print_help(None, None)
            sys.exit(1)
Ejemplo n.º 2
0
    def handle(self, *args, **options):

        if options['accounts']:
            for account in recurly.Account.all_active():
                print(dump(account))
        elif options['account']:
            account = recurly.Account.get(options['account'])
            print(dump(account))

        elif options['subscriptions']:
            for subscription in recurly.Subscription.all():
                print(dump(subscription))
        elif options['subscription']:
            subscription = recurly.Subscription.get(options['subscription'])
            print(dump(subscription))

        elif options['plans']:
            for plan in recurly.Plan.all():
                print(dump(plan))
        elif options['plan']:
            plan = recurly.Plan.get(options['plan'])
            print(dump(plan))

        else:
            self.print_help(None, None)
            sys.exit(1)
Ejemplo n.º 3
0
def get_signed_form_options(protected_params={}, unprotected_params={}):
    from django_recurly.utils import dict_merge

    # Protected params
    data = dict_merge({}, protected_params)
    data['signature'] = get_signature(data)

    # Unprotected params (overridden by existing protected params)
    data = dict_merge({}, unprotected_params, data)

    data['json'] = dump(data, js=True)

    return data