Template:2012FR/Form-section/Processing/Default: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
Created page with "<html> <script> function redirectPayment (legacyPaymentMethod) { // wrapper for redirectPayment2() // using old method parameters // until buttons can be updated ..."
 
No edit summary
Line 68:
}
var form = document.paypalcontribution; // we should really change this some day
var language = $("input[name='language']").val();
var paymentsURL = 'https://payments.wikimedia.org/index.php/Special:GatewayFormChooser';
var params = {
'uselang' : $("input[name='language']").val(),
'language' : $("input[name='language']").val(),
'currency' : $("input[name='currency_code']").val(),
'country' : $("input[name='country']").val(),
'paymentmethod' : paymentMethod
};
Line 100 ⟶ 99:
form.action = paymentsURL + '?' + $.param(params);
form.utm_source.value = '{{{banner}}}.no-LP' + '.' + paymentMethod;
form.payment_method.value = paymentMethod;
if( paymentSubMethod != '' ){
Line 114 ⟶ 112:
 
function addAnalytics () {
// thisstuffs codeparameters makesinto sureutm_source parametersto usedmake arethem accessibleavailable tofor analytics
 
var form = document.paypalcontribution;
document.paypalcontribution.utm_source.value = getQuerystring( 'utm_source' ) + '.';
 
form.utm_source.value = getQuerystring( '{{{banner}}}.no-LPutm_source' ) + '.' + paymentMethod;
 
if(getQuerystring( 'template' ) == '') {
document.paypalcontributionform.utm_source.value += 'default' + '~';
} else {
document.paypalcontributionform.utm_source.value += getQuerystring( 'template' ).replace("Lp-layout-","") + '~';
}
 
if(getQuerystring( 'appeal-template' ) == '') {
document.paypalcontributionform.utm_source.value += 'default' + '~';
} else {
document.paypalcontributionform.utm_source.value += getQuerystring( 'appeal-template' ).replace("Appeal-template-","") + '~';
}
 
if(getQuerystring( 'appeal' ) == '') {
document.paypalcontributionform.utm_source.value += 'default' + '~';
} else {
document.paypalcontributionform.utm_source.value += getQuerystring( 'appeal' ).replace("Appeal-","") + '~';
}
 
if(getQuerystring( 'form-template' ) == '') {
document.paypalcontributionform.utm_source.value += 'default' + '~';
} else {
document.paypalcontributionform.utm_source.value += getQuerystring( 'form-template' ).replace("Form-template-","") + '~';
}
 
if(getQuerystring( 'form-countryspecific' ) == '') {
document.paypalcontributionform.utm_source.value += 'control';
} else {
document.paypalcontributionform.utm_source.value += getQuerystring( 'form-countryspecific' ).replace("Form-countryspecific-","");
}
 
document.paypalcontributionform.utm_source.value += '.' + paymentTypeform.payment_method.value;
document.paypalcontributionform.utm_campaign.value = getQuerystring( 'utm_campaign' );
}
</script>

Revision as of 13:01, 16 October 2013