Template:2012FR/Form-section/Processing/Default: Difference between revisions
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: | Line 68: | ||
} |
} |
||
var form = document.paypalcontribution; // we should really change this some day |
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 paymentsURL = 'https://payments.wikimedia.org/index.php/Special:GatewayFormChooser'; |
||
var params = { |
var params = { |
||
'uselang' : language, |
'uselang' : $("input[name='language']").val(), |
||
'language' : language, |
'language' : $("input[name='language']").val(), |
||
'currency' : $("input[name='currency_code']").val(), |
'currency' : $("input[name='currency_code']").val(), |
||
'country' : $("input[name='country']").val(), |
'country' : $("input[name='country']").val(), |
||
'paymentmethod' : paymentMethod |
'paymentmethod' : paymentMethod |
||
}; |
}; |
||
Line 100: | Line 99: | ||
form.action = paymentsURL + '?' + $.param(params); |
form.action = paymentsURL + '?' + $.param(params); |
||
⚫ | |||
form.payment_method.value = paymentMethod; |
form.payment_method.value = paymentMethod; |
||
if( paymentSubMethod != '' ){ |
if( paymentSubMethod != '' ){ |
||
Line 114: | Line 112: | ||
function addAnalytics () { |
function addAnalytics () { |
||
// |
// stuffs parameters into utm_source to make them available for analytics |
||
var form = document.paypalcontribution; |
|||
document.paypalcontribution.utm_source.value = getQuerystring( 'utm_source' ) + '.'; |
|||
⚫ | |||
if(getQuerystring( 'template' ) == '') { |
if(getQuerystring( 'template' ) == '') { |
||
form.utm_source.value += 'default' + '~'; |
|||
} else { |
} else { |
||
form.utm_source.value += getQuerystring( 'template' ).replace("Lp-layout-","") + '~'; |
|||
} |
} |
||
if(getQuerystring( 'appeal-template' ) == '') { |
if(getQuerystring( 'appeal-template' ) == '') { |
||
form.utm_source.value += 'default' + '~'; |
|||
} else { |
} else { |
||
form.utm_source.value += getQuerystring( 'appeal-template' ).replace("Appeal-template-","") + '~'; |
|||
} |
} |
||
if(getQuerystring( 'appeal' ) == '') { |
if(getQuerystring( 'appeal' ) == '') { |
||
form.utm_source.value += 'default' + '~'; |
|||
} else { |
} else { |
||
form.utm_source.value += getQuerystring( 'appeal' ).replace("Appeal-","") + '~'; |
|||
} |
} |
||
if(getQuerystring( 'form-template' ) == '') { |
if(getQuerystring( 'form-template' ) == '') { |
||
form.utm_source.value += 'default' + '~'; |
|||
} else { |
} else { |
||
form.utm_source.value += getQuerystring( 'form-template' ).replace("Form-template-","") + '~'; |
|||
} |
} |
||
if(getQuerystring( 'form-countryspecific' ) == '') { |
if(getQuerystring( 'form-countryspecific' ) == '') { |
||
form.utm_source.value += 'control'; |
|||
} else { |
} else { |
||
form.utm_source.value += getQuerystring( 'form-countryspecific' ).replace("Form-countryspecific-",""); |
|||
} |
} |
||
form.utm_source.value += '.' + form.payment_method.value; |
|||
form.utm_campaign.value = getQuerystring( 'utm_campaign' ); |
|||
} |
} |
||
</script> |
</script> |
Revision as of 13:01, 16 October 2013