Template:2011FR/Form-section-processing: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
Cbarr (talk | contribs)
No edit summary
first pass at cleanup
Line 1: Line 1:
{{#ifeq:{{{handler}}}|GC
{{#ifeq:{{{handler}}}|GC
|<!-- Start of GlobalCollect handling code -->
|<html>
<html>

<script type="text/javascript" language="javascript">
<script type="text/javascript">

function redirectPayment(i) {
function redirectPayment(i) {


document.getElementsByName("currency_code")[0].value="</html>{{2011FR/core-currency-code|{{{country}}}}}<html>";
document.getElementsByName("currency_code")[0].value="</html>{{2011FR/core-currency-code|{{{country}}}}}<html>";
//************************************ credit card ************************************
//************************************ credit card ************************************
//if i == cc
//if i == cc
var paymentType ="cc";
var paymentType ="cc";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-CC-masthead|none}}}<html>\x26form_name=</html>{{{GC-CC-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-CC-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>"
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-CC-masthead|none}}}<html>\x26form_name=</html>{{{GC-CC-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-CC-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>"
if(monthlyDonation == true)
if(monthlyDonation == true) {
{
action_url += ("\x26ffname=</html>{{{GC-CC-ffname|webitects2nd}}}<html>").replace('cc','rcc');
action_url += ("\x26ffname=</html>{{{GC-CC-ffname|webitects2nd}}}<html>").replace('cc','rcc');
}
} else {
else
{
action_url += "\x26ffname=</html>{{{GC-CC-ffname|webitects2nd}}}<html>";
action_url += "\x26ffname=</html>{{{GC-CC-ffname|webitects2nd}}}<html>";
}
}
Line 22: Line 18:
//****************************** realtime **************************************************
//****************************** realtime **************************************************
if (i=="rtbt-ideal"){
if (i=="rtbt-ideal") {
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-DD-masthead|none}}}<html>\x26form_name=</html>{{{GC-DD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-DD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-ideal-ffname|rtbt-ideal}}}\x26payment_method=rtbt<html>";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-DD-masthead|none}}}<html>\x26form_name=</html>{{{GC-DD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-DD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-ideal-ffname|rtbt-ideal}}}\x26payment_method=rtbt<html>";
}
}


if (i=="rtbt-eps"){
if (i=="rtbt-eps") {
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-DD-masthead|none}}}<html>\x26form_name=</html>{{{GC-DD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-DD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-ideal-ffname|rtbt-eps}}}\x26payment_method=rtbt<html>";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-DD-masthead|none}}}<html>\x26form_name=</html>{{{GC-DD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-DD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-ideal-ffname|rtbt-eps}}}\x26payment_method=rtbt<html>";
}
}


if (i=="rtbt-sofo"){
if (i=="rtbt-sofo") {
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-DD-masthead|none}}}<html>\x26form_name=</html>{{{GC-DD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-DD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-ideal-ffname|rtbt-sofo}}}\x26payment_method=rtbt<html>";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-DD-masthead|none}}}<html>\x26form_name=</html>{{{GC-DD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-DD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-ideal-ffname|rtbt-sofo}}}\x26payment_method=rtbt<html>";
}
}
Line 36: Line 32:


//****************************** Bank Transfer ***********************************
//****************************** Bank Transfer ***********************************
if (i=="bt"){
if (i=="bt") {
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-BT-masthead|none}}}<html>\x26form_name=</html>{{{GC-BT-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-BT-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-BT-ffname|bt}}}\x26payment_method=bt<html>";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-BT-masthead|none}}}<html>\x26form_name=</html>{{{GC-BT-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-BT-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-BT-ffname|bt}}}\x26payment_method=bt<html>";
}
}
//****************************** Online Bank Transfer ***********************************
//****************************** Online Bank Transfer ***********************************


if (i=="obt-bp"){
if (i=="obt-bp") {
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-BP-masthead|none}}}<html>\x26form_name=</html>{{{GC-BP-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-BP-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-BP-ffname|obt-bpay}}}\x26payment_method=obt<html>";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-BP-masthead|none}}}<html>\x26form_name=</html>{{{GC-BP-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-BP-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-BP-ffname|obt-bpay}}}\x26payment_method=obt<html>";
}
}


//****************************** Direct Debit ***********************************
//****************************** Direct Debit ***********************************
if (i=="dd"){
if (i=="dd") {
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-DD-masthead|none}}}<html>\x26form_name=</html>{{{GC-DD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-DD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-DD-ffname|webitects2nd}}}\x26payment_method=dd<html>";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-DD-masthead|none}}}<html>\x26form_name=</html>{{{GC-DD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-DD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-DD-ffname|webitects2nd}}}\x26payment_method=dd<html>";
}
}
Line 53: Line 49:


//********************************** eWallets *******************************************
//********************************** eWallets *******************************************
if (i=="pp"||i=="ew-pp"){
if (i=="pp"||i=="ew-pp") {
paymentType = "pp";
paymentType = "pp";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
Line 62: Line 58:
document.paypalcontribution.appendChild(gateway);
document.paypalcontribution.appendChild(gateway);


if(monthlyDonation == true)
if (monthlyDonation == true) {
{
var recurring = document.createElement("input");
var recurring = document.createElement("input");
recurring.type = "hidden";
recurring.type = "hidden";
Line 73: Line 68:
}
}


if (i=="ew-pp-usd"){
if (i=="ew-pp-usd") {
paymentType = "pp";
paymentType = "pp";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
Line 83: Line 78:
document.getElementsByName("currency_code")[0].value="USD";
document.getElementsByName("currency_code")[0].value="USD";
document.getElementsByName("amountGiven")[0].value="";
document.getElementsByName("amountGiven")[0].value="";
for ( var j = 0; j < document.getElementsByName("amount").length; j++ )
for ( var j = 0; j < document.getElementsByName("amount").length; j++ ) {
{
document.getElementsByName("amount")[j].checked=false;
document.getElementsByName("amount")[j].checked=false;
}
}
if(monthlyDonation == true)
if (monthlyDonation == true) {
{
var recurring = document.createElement("input");
var recurring = document.createElement("input");
recurring.type = "hidden";
recurring.type = "hidden";
Line 98: Line 91:
}
}


if (i=="rpp"||i=="ew-rpp"){
if (i=="rpp"||i=="ew-rpp") {
paymentType= "pp";
paymentType= "pp";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
Line 115: Line 108:
}
}


if (i=="ew-webmoney"){
if (i=="ew-webmoney") {
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-BT-masthead|none}}}<html>\x26form_name=</html>{{{GC-BT-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-BT-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-BT-ffname|ew-webmoney}}}\x26payment_method=wm<html>";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-BT-masthead|none}}}<html>\x26form_name=</html>{{{GC-BT-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-BT-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-BT-ffname|ew-webmoney}}}\x26payment_method=wm<html>";
}
}


//************************************** needs to be configured **************************************
//************************************** needs to be configured **************************************
if (i=="ew-yd"){
if (i=="ew-yd") {
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-YD-masthead|none}}}<html>\x26form_name=</html>{{{GC-YD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-YD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-YD-ffname|webitects2nd}}}\x26payment_method=yd<html>";
var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-YD-masthead|none}}}<html>\x26form_name=</html>{{{GC-YD-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-YD-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-YD-ffname|webitects2nd}}}\x26payment_method=yd<html>";
}
}


if (i=="ew-mb"){
if (i=="ew-mb") {
paymentType = "pp";
paymentType = "pp";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
Line 146: Line 139:
else
else
document.paypalcontribution.utm_source.value += getQuerystring( 'template' ).replace("Lp-layout-","") + '~';
document.paypalcontribution.utm_source.value += getQuerystring( 'template' ).replace("Lp-layout-","") + '~';
if(getQuerystring( 'appeal-template' )=='')
if(getQuerystring( 'appeal-template' )=='')
document.paypalcontribution.utm_source.value += 'default' + '~';
document.paypalcontribution.utm_source.value += 'default' + '~';
else
else
document.paypalcontribution.utm_source.value += getQuerystring( 'appeal-template' ).replace("Appeal-template-","") + '~';
document.paypalcontribution.utm_source.value += getQuerystring( 'appeal-template' ).replace("Appeal-template-","") + '~';
if(getQuerystring( 'appeal' )=='')
if(getQuerystring( 'appeal' )=='')
document.paypalcontribution.utm_source.value += 'default' + '~';
document.paypalcontribution.utm_source.value += 'default' + '~';
else
else
document.paypalcontribution.utm_source.value += getQuerystring( 'appeal' ).replace("Appeal-","") + '~';
document.paypalcontribution.utm_source.value += getQuerystring( 'appeal' ).replace("Appeal-","") + '~';
if(getQuerystring( 'form-template' )=='')
if(getQuerystring( 'form-template' )=='')
document.paypalcontribution.utm_source.value += 'default' + '~';
document.paypalcontribution.utm_source.value += 'default' + '~';
else
else
document.paypalcontribution.utm_source.value += getQuerystring( 'form-template' ).replace("Form-template-","") + '~';
document.paypalcontribution.utm_source.value += getQuerystring( 'form-template' ).replace("Form-template-","") + '~';
if(getQuerystring( 'form-countryspecific' )=='')
if(getQuerystring( 'form-countryspecific' )=='')
document.paypalcontribution.utm_source.value += 'control';
document.paypalcontribution.utm_source.value += 'control';
Line 165: Line 162:
document.paypalcontribution.utm_source.value += '.' + paymentType;
document.paypalcontribution.utm_source.value += '.' + paymentType;


document.paypalcontribution.utm_campaign.value = getQuerystring( 'utm_campaign' );
document.paypalcontribution.utm_campaign.value = getQuerystring( 'utm_campaign' );
//****************************** End Faulkner ******************************************************
//****************************** End Faulkner ******************************************************


Line 179: Line 176:
</script>
</script>
</html>
</html>
<!-- End of GlobalCollect handling code -->
|
|
<!-- Start of NON-GlobalCollect handling code -->
<html>
<html>
<script type="text/javascript" language="javascript">
<script type="text/javascript">
function redirectPayment(i) {
function redirectPayment(i) {


Line 196: Line 195:
gateway.value = "paypal";
gateway.value = "paypal";
document.paypalcontribution.appendChild(gateway);
document.paypalcontribution.appendChild(gateway);
}
}


if (i=="rpp"){
if (i=="rpp") {
paymentType = "pp";
paymentType = "pp";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
Line 213: Line 212:
recurring.value = "true";
recurring.value = "true";
document.paypalcontribution.appendChild(recurring);
document.paypalcontribution.appendChild(recurring);
}
}
document.paypalcontribution.action = action_url;
document.paypalcontribution.action = action_url;


// ************************Do not change without the permission of Faulkner***************************
// ************************Do not change without the permission of Faulkner***************************
document.paypalcontribution.utm_source.value = getQuerystring( 'utm_source' ) + '.'
document.paypalcontribution.utm_source.value = getQuerystring( 'utm_source' ) + '.'
+ getQuerystring( 'template' ).replace("Lp-layout-","") + '~'
+ getQuerystring( 'template' ).replace("Lp-layout-","") + '~'
+ getQuerystring( 'appeal-template' ).replace("Appeal-template-","") + '~'
+ getQuerystring( 'appeal-template' ).replace("Appeal-template-","") + '~'
Line 225: Line 225:
+ paymentType;
+ paymentType;


document.paypalcontribution.utm_campaign.value = getQuerystring( 'utm_campaign' );
document.paypalcontribution.utm_campaign.value = getQuerystring( 'utm_campaign' );
//****************************** End Faulkner ******************************************************
//****************************** End Faulkner ******************************************************


Line 235: Line 235:
</script>
</script>
</html>
</html>
<!-- End of NON-GlobalCollect handling code -->
}}
}}

Revision as of 16:56, 24 January 2012