Template:2012FR/Form-section/Processing/Default: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
strip legacy function, no longer used |
remove paypal_ec override for Japan, it's default everywhere now |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 9: | Line 9: | ||
donationForm.redirectPayment = function(paymentMethod, paymentSubMethod, skipValidation) { |
donationForm.redirectPayment = function(paymentMethod, paymentSubMethod, skipValidation) { |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
var form = document.paypalcontribution; // we should really change this some day |
var form = document.paypalcontribution; // we should really change this some day |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
var params = { |
|||
paymentSubMethod = ''; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
'currency' : $("input[name='currency_code']").val(), |
|||
'country' : $("input[name='country']").val(), |
|||
form.action = paymentsURL; |
|||
}; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
if (typeof paymentSubMethod == 'undefined') { |
|||
⚫ | |||
// Testing for Adyen |
|||
⚫ | |||
⚫ | |||
⚫ | |||
// WorldPay override for cc |
|||
params.paymentmethod = 'cc'; |
|||
if( paymentMethod === 'cc-wp' ) { |
|||
⚫ | |||
⚫ | |||
⚫ | |||
form.gateway.value = 'worldpay'; |
|||
var frequency = $("input[name='frequency']:checked").val(); |
|||
form.ffname.value = 'worldpay'; |
|||
⚫ | |||
} |
|||
// commented out below as it breaks eNETS for some reason |
|||
// |
// Adyen override for cc |
||
⚫ | |||
⚫ | |||
paymentMethod = 'cc'; |
|||
⚫ | |||
// the following causes tons of errors. Don't. |
|||
form.gateway.value = 'adyen'; |
|||
⚫ | |||
} |
} |
||
form.action = paymentsURL + '?' + $.param(params); |
|||
⚫ | |||
⚫ | |||
if( |
if( frequency !== 'monthly' ){ |
||
⚫ | |||
⚫ | |||
form.recurring.value = 'false'; |
|||
⚫ | |||
⚫ | |||
form.recurring.value = 'true'; |
|||
⚫ | |||
form.payment_method.value = paymentMethod; |
|||
⚫ | |||
⚫ | |||
var full_dotted_payment_method = paymentMethod; |
|||
if ( form.recurring.value == 'true' ) { |
|||
full_dotted_payment_method = 'r' + full_dotted_payment_method; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
form.utm_source.value += '.' + full_dotted_payment_method; |
|||
form.method = "GET"; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
form.submit(); |
form.submit(); |
||
} |
} |
||
} |
}; |
||
donationForm.addAnalytics = function() { |
donationForm.addAnalytics = function() { |
||
Line 99: | Line 108: | ||
} |
} |
||
⚫ | |||
form.utm_campaign.value = getQuerystring( 'utm_campaign' ); |
form.utm_campaign.value = getQuerystring( 'utm_campaign' ); |
||
} |
}; |
||
donationForm.toggleMonthly = function(monthly) { |
donationForm.toggleMonthly = function(monthly) { |
||
Line 109: | Line 117: | ||
$('#form-wrapper').removeClass('form-monthly'); |
$('#form-wrapper').removeClass('form-monthly'); |
||
} |
} |
||
} |
}; |
||
</script> |
</script> |
||
</html> |
</html> |
Revision as of 18:19, 8 March 2018