def get_side_list(user, perms): from helomx.mxhelpers import get_mx_list engineer = Engineer.objects.get(user__username=user.username) company=engineer.company mailserver_list = get_mx_list(company) engineer_list = Engineer.objects.filter(company=company) return {'mailserver_list': mailserver_list, 'engineer_list': engineer_list, 'company': company, 'perms':perms}
def mailserver_dropdown(user, perms): from helomx.mxhelpers import get_mx_list try: engineer = Engineer.objects.get(user__username=user.username) company=engineer.company mailserver_list = get_mx_list(company) except: mailserver_list = None engineer = None company = None return {'mailserver_list': mailserver_list, 'company': company, 'perms':perms}
def pay_invoice(request): from random import random engineer = Engineer.objects.get(user__username=request.user.username) mailserver_list = get_mx_list(engineer.company) message = None company = engineer.company engineer_list = Engineer.objects.filter(company=company) inv_num = int(random()*10000000) # What you want the button to do. ten_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "10.00", "invoice": inv_num, 'custom':"%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } test_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "1.00", "invoice": inv_num, 'custom':"%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } tf_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "25.00", "invoice": inv_num, 'custom':"%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } f_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "50.00", "invoice": inv_num, 'custom':"%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } oh_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "100.00", "invoice": inv_num, 'custom':"%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } fh_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "500.00", "invoice": inv_num, 'custom':"%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } # Create the instance. #coupon_form = CouponForm(request.POST) return render_to_response("billing/payment.html", { 'mailserver_list': mailserver_list, 'message': message, 'company': company, 'engineer_list': engineer_list, 'test_dolla_form': PayPalEncryptedPaymentsForm(initial=test_dolla_dict), 'ten_dolla_form': PayPalEncryptedPaymentsForm(initial=ten_dolla_dict), 'tf_dolla_form': PayPalEncryptedPaymentsForm(initial=tf_dolla_dict), 'f_dolla_form': PayPalEncryptedPaymentsForm(initial=f_dolla_dict), 'oh_dolla_form': PayPalEncryptedPaymentsForm(initial=oh_dolla_dict), 'fh_dolla_form': PayPalEncryptedPaymentsForm(initial=fh_dolla_dict), }, context_instance=RequestContext(request))
def pay_invoice(request): from random import random engineer = Engineer.objects.get(user__username=request.user.username) mailserver_list = get_mx_list(engineer.company) message = None company = engineer.company engineer_list = Engineer.objects.filter(company=company) inv_num = int(random() * 10000000) # What you want the button to do. ten_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "10.00", "invoice": inv_num, 'custom': "%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } test_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "1.00", "invoice": inv_num, 'custom': "%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } tf_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "25.00", "invoice": inv_num, 'custom': "%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } f_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "50.00", "invoice": inv_num, 'custom': "%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } oh_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "100.00", "invoice": inv_num, 'custom': "%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } fh_dolla_dict = { "business": "*****@*****.**", "item_name": "HeloMX Credit", "amount": "500.00", "invoice": inv_num, 'custom': "%s" % company.slug, "notify_url": "https://www.helomx.com/paypal/api/notify/", "return_url": "https://www.helomx.com/dashboard/?success=funds", "cancel_return": "https://www.helomx.com/dashboard/?success=fundscancel", } # Create the instance. #coupon_form = CouponForm(request.POST) return render_to_response( "billing/payment.html", { 'mailserver_list': mailserver_list, 'message': message, 'company': company, 'engineer_list': engineer_list, 'test_dolla_form': PayPalEncryptedPaymentsForm(initial=test_dolla_dict), 'ten_dolla_form': PayPalEncryptedPaymentsForm(initial=ten_dolla_dict), 'tf_dolla_form': PayPalEncryptedPaymentsForm(initial=tf_dolla_dict), 'f_dolla_form': PayPalEncryptedPaymentsForm(initial=f_dolla_dict), 'oh_dolla_form': PayPalEncryptedPaymentsForm(initial=oh_dolla_dict), 'fh_dolla_form': PayPalEncryptedPaymentsForm(initial=fh_dolla_dict), }, context_instance=RequestContext(request))