Merge pull request #520 from ungleich/bugfix/stripe_js_error

Bugfix/stripe js error in confirm order page
This commit is contained in:
Pcoder 2017-10-12 19:10:28 +02:00 committed by GitHub
commit 3b9cfed794
2 changed files with 4 additions and 45 deletions

View file

@ -5,16 +5,15 @@ from django.conf.urls.static import static
from django.views import i18n, static as static_view from django.views import i18n, static as static_view
from django.conf import settings from django.conf import settings
from hosting.views import RailsHostingView, DjangoHostingView, NodeJSHostingView from hosting.views import (
RailsHostingView, DjangoHostingView, NodeJSHostingView
)
from membership import urls as membership_urls from membership import urls as membership_urls
from ungleich_page.views import LandingView from ungleich_page.views import LandingView
from django.views.generic import RedirectView from django.views.generic import RedirectView
from django.core.urlresolvers import reverse_lazy from django.core.urlresolvers import reverse_lazy
import debug_toolbar import debug_toolbar
from django.views.generic import TemplateView
urlpatterns = [ urlpatterns = [
url(r'^index.html$', LandingView.as_view()), url(r'^index.html$', LandingView.as_view()),
url(r'^open_api/', include('opennebula_api.urls', url(r'^open_api/', include('opennebula_api.urls',

View file

@ -49,7 +49,7 @@ $(document).ready(function () {
var hasCreditcard = window.hasCreditcard || false; var hasCreditcard = window.hasCreditcard || false;
if (!hasCreditcard) { if (!hasCreditcard && window.stripeKey) {
var stripe = Stripe(window.stripeKey); var stripe = Stripe(window.stripeKey);
var element_style = { var element_style = {
fonts: [{ 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"; var enter_ccard_text = "Enter your credit card number";
if (typeof window.enter_your_card_text !== 'undefined') { 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'); var submit_form_btn = $('#payment_button_with_creditcard');
submit_form_btn.on('click', submit_payment); submit_form_btn.on('click', submit_payment);
@ -148,11 +121,7 @@ $(document).ready(function () {
function submit_payment(e) { function submit_payment(e) {
e.preventDefault(); e.preventDefault();
console.log("creditcard sdasd");
// if (hasCreditcard) {
$('#billing-form').submit(); $('#billing-form').submit();
// }
} }
@ -164,7 +133,6 @@ $(document).ready(function () {
function stripeTokenHandler(token) { function stripeTokenHandler(token) {
// Insert the token ID into the form so it gets submitted to the server // 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); $('#id_token').val(token.id);
$('#billing-form').submit(); $('#billing-form').submit();
} }
@ -227,13 +195,5 @@ $(document).ready(function () {
$(element).closest('.form-group').append(error); $(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);
}); });