Create Stripe elements only stripe key is defined
This commit is contained in:
parent
8678f7f8ea
commit
1b14598cc9
1 changed files with 1 additions and 35 deletions
|
@ -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') {
|
||||||
|
@ -164,7 +139,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 +201,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);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue