merged master
This commit is contained in:
		
				commit
				
					
						7b71ba1749
					
				
			
		
					 39 changed files with 1484 additions and 1704 deletions
				
			
		| 
						 | 
				
			
			@ -29,6 +29,8 @@ class HostingUserLoginForm(forms.Form):
 | 
			
		|||
    def clean(self):
 | 
			
		||||
        email = self.cleaned_data.get('email')
 | 
			
		||||
        password = self.cleaned_data.get('password')
 | 
			
		||||
        if self.errors:
 | 
			
		||||
            return self.cleaned_data
 | 
			
		||||
        is_auth = authenticate(email=email, password=password)
 | 
			
		||||
        if not is_auth:
 | 
			
		||||
            raise forms.ValidationError(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,7 +8,7 @@ msgid ""
 | 
			
		|||
msgstr ""
 | 
			
		||||
"Project-Id-Version: PACKAGE VERSION\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: \n"
 | 
			
		||||
"POT-Creation-Date: 2017-10-03 23:48+0530\n"
 | 
			
		||||
"POT-Creation-Date: 2017-10-10 21:35+0530\n"
 | 
			
		||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 | 
			
		||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 | 
			
		||||
"Language-Team: LANGUAGE <LL@li.org>\n"
 | 
			
		||||
| 
						 | 
				
			
			@ -173,6 +173,9 @@ msgstr "Anmelden"
 | 
			
		|||
msgid "Create VM"
 | 
			
		||||
msgstr "VM erstellen"
 | 
			
		||||
 | 
			
		||||
msgid "Affordable VM hosting based in Switzerland"
 | 
			
		||||
msgstr "Bezahlbares VM Hosting in der Schweiz"
 | 
			
		||||
 | 
			
		||||
msgid "My Dashboard"
 | 
			
		||||
msgstr "Mein Dashboard"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,7 +49,7 @@ $(document).ready(function () {
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
    var hasCreditcard = window.hasCreditcard || false;
 | 
			
		||||
    if (!hasCreditcard) {
 | 
			
		||||
    if (!hasCreditcard && window.stripeKey) {
 | 
			
		||||
        var stripe = Stripe(window.stripeKey);
 | 
			
		||||
        var element_style = {
 | 
			
		||||
            fonts: [{
 | 
			
		||||
| 
						 | 
				
			
			@ -88,31 +88,6 @@ $(document).ready(function () {
 | 
			
		|||
                }
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
        var credit_card_cvv_style = {
 | 
			
		||||
            base: {
 | 
			
		||||
                iconColor: '#666EE8',
 | 
			
		||||
                color: '#31325F',
 | 
			
		||||
                lineHeight: '25px',
 | 
			
		||||
                fontWeight: 300,
 | 
			
		||||
                fontFamily: "'lato-regular', sans-serif",
 | 
			
		||||
                fontSize: '14px',
 | 
			
		||||
                '::placeholder': {
 | 
			
		||||
                    color: '#555'
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
            invalid: {
 | 
			
		||||
                iconColor: '#eb4d5c',
 | 
			
		||||
                color: '#eb4d5c',
 | 
			
		||||
                lineHeight: '25px',
 | 
			
		||||
                fontWeight: 300,
 | 
			
		||||
                fontFamily: "'lato-regular', sans-serif",
 | 
			
		||||
                fontSize: '14px',
 | 
			
		||||
                '::placeholder': {
 | 
			
		||||
                    color: '#eb4d5c',
 | 
			
		||||
                    fontWeight: 600
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        var enter_ccard_text = "Enter your credit card number";
 | 
			
		||||
        if (typeof window.enter_your_card_text !== 'undefined') {
 | 
			
		||||
| 
						 | 
				
			
			@ -139,8 +114,6 @@ $(document).ready(function () {
 | 
			
		|||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    console.log("has creditcard", hasCreditcard);
 | 
			
		||||
    // hasCreditcard= true;
 | 
			
		||||
 | 
			
		||||
    var submit_form_btn = $('#payment_button_with_creditcard');
 | 
			
		||||
    submit_form_btn.on('click', submit_payment);
 | 
			
		||||
| 
						 | 
				
			
			@ -148,11 +121,7 @@ $(document).ready(function () {
 | 
			
		|||
 | 
			
		||||
    function submit_payment(e) {
 | 
			
		||||
        e.preventDefault();
 | 
			
		||||
        console.log("creditcard sdasd");
 | 
			
		||||
        // if (hasCreditcard) {
 | 
			
		||||
        $('#billing-form').submit();
 | 
			
		||||
        // }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -164,7 +133,6 @@ $(document).ready(function () {
 | 
			
		|||
 | 
			
		||||
        function stripeTokenHandler(token) {
 | 
			
		||||
            // Insert the token ID into the form so it gets submitted to the server
 | 
			
		||||
            var form = document.getElementById('payment-form-new');
 | 
			
		||||
            $('#id_token').val(token.id);
 | 
			
		||||
            $('#billing-form').submit();
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -227,13 +195,5 @@ $(document).ready(function () {
 | 
			
		|||
            $(element).closest('.form-group').append(error);
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
    // $form.find('[type=submit]').prop('disabled', true);
 | 
			
		||||
    // var readyInterval = setInterval(function() {
 | 
			
		||||
    //     if (paymentFormReady()) {
 | 
			
		||||
    //         $form.find('[type=submit]').prop('disabled', false);
 | 
			
		||||
    //         clearInterval(readyInterval);
 | 
			
		||||
    //     }
 | 
			
		||||
    // }, 250);
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,7 +33,7 @@
 | 
			
		|||
    <link href='//fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
 | 
			
		||||
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
 | 
			
		||||
    <link href="//fonts.googleapis.com/css?family=Lato:300,400,500,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
 | 
			
		||||
    <link rel="shortcut icon" href="{% static 'hosting/img/favicon.ico' %}" type="image/x-icon" />
 | 
			
		||||
    <link rel="shortcut icon" href="{% static 'datacenterlight/img/favicon.ico' %}" type="image/x-icon" />
 | 
			
		||||
 | 
			
		||||
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | 
			
		||||
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,7 @@
 | 
			
		|||
        <div class="col-sm-5">
 | 
			
		||||
          <div class="dashboard-container-head">
 | 
			
		||||
                <h3 class="dashboard-title-thin"><img src="{% static 'hosting/img/plusVM.svg' %}" class="un-icon" style="margin-top: -18px;width: 42px;height: 42px;"> {% trans "Create VM" %}</h3>
 | 
			
		||||
                <p style="padding-left: 16px;">{% trans "Affordable VM hosting based in Switzerland" %}</p>
 | 
			
		||||
                {% if messages %}
 | 
			
		||||
                    <div class="alert alert-warning">
 | 
			
		||||
                        {% for message in messages %}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -762,14 +762,15 @@ class OrdersHostingDetailView(LoginRequiredMixin,
 | 
			
		|||
    def post(self, request):
 | 
			
		||||
        template = request.session.get('template')
 | 
			
		||||
        specs = request.session.get('specs')
 | 
			
		||||
        stripe_customer_id = request.session.get('customer')
 | 
			
		||||
        customer = StripeCustomer.objects.filter(id=stripe_customer_id).first()
 | 
			
		||||
        # We assume that if the user is here, his/her StripeCustomer
 | 
			
		||||
        # object already exists
 | 
			
		||||
        stripe_customer_id = request.user.stripecustomer.id
 | 
			
		||||
        billing_address_data = request.session.get('billing_address_data')
 | 
			
		||||
        vm_template_id = template.get('id', 1)
 | 
			
		||||
 | 
			
		||||
        stripe_api_cus_id = self.request.session.get('customer')
 | 
			
		||||
        # Make stripe charge to a customer
 | 
			
		||||
        stripe_utils = StripeUtils()
 | 
			
		||||
        card_details = stripe_utils.get_card_details(customer.stripe_id,
 | 
			
		||||
        card_details = stripe_utils.get_card_details(stripe_api_cus_id,
 | 
			
		||||
                                                     request.session.get(
 | 
			
		||||
                                                         'token'))
 | 
			
		||||
        if not card_details.get('response_object'):
 | 
			
		||||
| 
						 | 
				
			
			@ -796,7 +797,7 @@ class OrdersHostingDetailView(LoginRequiredMixin,
 | 
			
		|||
            name=plan_name,
 | 
			
		||||
            stripe_plan_id=stripe_plan_id)
 | 
			
		||||
        subscription_result = stripe_utils.subscribe_customer_to_plan(
 | 
			
		||||
            customer.stripe_id,
 | 
			
		||||
            stripe_api_cus_id,
 | 
			
		||||
            [{"plan": stripe_plan.get(
 | 
			
		||||
                'response_object').stripe_plan_id}])
 | 
			
		||||
        stripe_subscription_obj = subscription_result.get('response_object')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue