Version 3.4.5
This commit is contained in:
1 parent
fb6b5baabc
commit
e4478369d8
1360 files changed
+228921
-179445
No files matched your search
@@ -7,30 +7,39 @@
|
||||
/* Author: Mark Wade */
|
||||
/************************************************/
|
||||
|
||||
var checkoutStarted = false;
|
||||
|
||||
var nexusCheckout = {
|
||||
|
||||
submitForm: function( transid, submit )
|
||||
{
|
||||
{
|
||||
// Check we have selected a method
|
||||
if( $('payment_toggle').value == '--' )
|
||||
if( $('payment_toggle') != undefined && $('payment_toggle').value == '--' )
|
||||
{
|
||||
alert( ipb.lang['checkout_nomethod'] );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Check we agreed to the terms
|
||||
if ( $('tac-checkbox') != null && $('tac-checkbox').checked == false )
|
||||
{
|
||||
alert("{$this->lang->words['checkout_accept_terms']}");
|
||||
alert( ipb.lang['checkout_accept_terms'] );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if( checkoutStarted )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
checkoutStarted = true;
|
||||
|
||||
// Disable the button
|
||||
if ( $('pay_submit') != null )
|
||||
{
|
||||
$('pay_submit').disabled = 'disabled';
|
||||
}
|
||||
|
||||
|
||||
// Call MaxMind
|
||||
if ( $('card_number') == null )
|
||||
{
|
||||
@@ -40,7 +49,7 @@ var nexusCheckout = {
|
||||
{
|
||||
var bin = $('card_number').value.replace( ' ', '' ).replace( '-', '' ).substr( 0, 6 );
|
||||
}
|
||||
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=nexus&module=ajax§ion=store&do=fraud&secure_key="+ipb.vars['secure_hash'],
|
||||
{
|
||||
asynchronous: false,
|
||||
@@ -68,17 +77,37 @@ var nexusCheckout = {
|
||||
});
|
||||
},
|
||||
|
||||
stripeButtonClick: function( data, transid )
|
||||
submitCardForm: function()
|
||||
{
|
||||
if ( $('exp_month').value && $('exp_month').value != '00' && $('card_number').value.substr( 0, 4 ) == 'XXXX' )
|
||||
{
|
||||
alert( ipb.lang['info_card_newexpire'] );
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
stripeButtonClick: function( data, transid, cardUpdate )
|
||||
{
|
||||
// Do normal checks
|
||||
if ( transid )
|
||||
{
|
||||
nexusCheckout.submitForm( transid, false );
|
||||
if ( nexusCheckout.submitForm( transid, false ) == false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( cardUpdate )
|
||||
{
|
||||
if ( nexusCheckout.submitCardForm() == false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Only send to Stripe if we've not ticked the "Use Card on File" box and we're not doing something else
|
||||
if ( ( $('cardonfile') == null || $('cardonfile').value != 'on' ) && $('card_number').value.substr( 0, 4 ) != 'XXXX' && $('card_number').value.substr( 0, 4 ) != '' )
|
||||
{
|
||||
if ( ( $('cardonfile') == null || $('cardonfile').checked == false ) && $('card_number').value.substr( 0, 4 ) != 'XXXX' && $('card_number').value.substr( 0, 4 ) != '' )
|
||||
{
|
||||
// Fetch card data
|
||||
data.number = $('card_number').value;
|
||||
data.cvc = $('code').value;
|
||||
@@ -93,8 +122,7 @@ var nexusCheckout = {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
{
|
||||
$('do_pay').submit();
|
||||
}
|
||||
},
|
||||
@@ -114,7 +142,7 @@ var nexusCheckout = {
|
||||
},
|
||||
|
||||
changeCardMethod: function()
|
||||
{
|
||||
{
|
||||
var key = $( 'card_method_' + $('cc_method').value ).readAttribute('data-extra');
|
||||
if ( key )
|
||||
{
|
||||
@@ -122,7 +150,7 @@ var nexusCheckout = {
|
||||
}
|
||||
else
|
||||
{
|
||||
$('info_form').onsubmit = null;
|
||||
$('do_pay').onsubmit = null;
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user