Exemple #1
0
    def handle_noargs(self, **options):
        """ Compare existing payment plans """

        # authorize on remote server
        CG.auth(settings.CHEDDAR_GETTER_USER, settings.CHEDDAR_GETTER_PASS)
        CG.set_product_code(settings.CHEDDAR_GETTER_PRODUCT)

        # fetch plans
        plans_remote = Plan.all()
        plans_map = dict([(x.code, x) for x in plans_remote])
        plans_local = SubscriptionPlan.objects.all()

        # compare by name
        for plan in plans_local:
            is_match = plan.code in plans_map
            print plan.name, '..', 'match' if is_match else 'NO MATCH'
Exemple #2
0
def authorize_CG_gateway():
    """ Initialize CheddarGetter """
    CG.auth(settings.CHEDDAR_GETTER_USER, settings.CHEDDAR_GETTER_PASS)
    CG.set_product_code(settings.CHEDDAR_GETTER_PRODUCT)