Skip to content

Instantly share code, notes, and snippets.

@flexgrip
Created October 14, 2014 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flexgrip/eec5a145627709680d81 to your computer and use it in GitHub Desktop.
Save flexgrip/eec5a145627709680d81 to your computer and use it in GitHub Desktop.
elif request == 'registration-status':
rid = self.request.POST.get('reg_id')
reg = Registration.get_by_id(int(rid))
if not reg:
body = {'status': 'error', 'message': 'Registration failed!'}
if reg.status == 'finished':
account = reg.account.get()
plan_type = 'standard'
if account.is_pro:
plan_type = 'pro'
elif account.is_enterprise:
plan_type = 'enterprise'
period = account.subscription_period
if reg.template:
template = reg.template.get()
rev = template.price
else:
template = None
rev = prod.get('price')
source = 'marketplace' if reg.template else 'homepage'
# http://leadpages.net/?converted_sale_plan_type=[standard/pro]&revenue=[37/67/297/477]&converted_sale_billing_cycle=[month/year
thank_you_url += '?checkinbox=true'
thank_you_url += '&pln=%s' % product
thank_you_url += '&converted_sale_plan_type=%s' % plan_type
thank_you_url += '&revenue=%s' % rev
thank_you_url += '&converted_sale_billing_cycle=%s' % period
thank_you_url += '&source=%s' % source
if template:
thank_you_url += '&tid=%s' % template.tid
body = {'status': 'finished', 'message': 'Your account is ready!', 'url': thank_you_url}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment