Revision 23158 of "Template:2012FR/Form-section/Processing/Random2ndStep" on donatewiki

<div>{{#ifeq:{{{handler}}}|GC
|<!-- Start of GlobalCollect handling code -->
<html>
<script type="text/javascript">

function redirectPayment(i) {
    document.getElementsByName("currency_code")[0].value="</html>{{{currency|{{2012FR/Switch/Currency/Code|{{{country}}}}}}}}<html>";
//************************************ credit card ************************************
  //if i == cc

   var ffnames = "</html>{{{GC-CC-ffname|cc-vm}}}<html>";
   ffnames = ffnames.split( ',' );
   var random = Math.floor( Math.random() * ffnames.length );
   var choice = ffnames[ random ];

    var paymentType ="cc";
    var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26form_name=</html>{{{GC-CC-form-name|RapidHtml}}}<html>\x26appeal=JimmyQuote"
    if(monthlyDonation == true) {
      action_url += ("\x26ffname=</html>{{{GC-CC-ffname|cc-vm}}}<html>").replace('cc','rcc');
    }
    else {
      action_url += "\x26ffname=" + choice + "";
    }
//************************************ credit card ************************************
  
//******************************   realtime **************************************************
  if (i=="rtbt-id") {
    var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=</html>{{int:lang}}<html>\x26masthead=</html>{{{GC-RT-masthead|none}}}<html>\x26form_name=</html>{{{GC-RT-form-name|RapidHtml}}}<html>\x26text_template=</html>{{{GC-RT-text-template|2010/JimmyQuote-green}}}<html>\x26appeal=JimmyQuote-green\x26language=</html>{{int:lang}}<html>\x26ffname=</html>{{{GC-RT-ffname|rtbt-ideal}}}\x26payment_method=rtbt<html>";
  }

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

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

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

//****************************** Bank Transfer ***********************************
  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>";
  }
//****************************** Online Bank Transfer ***********************************

 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>";
  }

//****************************** Direct Debit ***********************************
  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>";
  }

//****************************** Direct Debit ***********************************

//**********************************  eWallets *******************************************
  if (i=="ew-pp") {
    paymentType = "pp";
    action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
    var gateway = document.createElement("input");	 
        gateway.type = "hidden";	
        gateway.name = "gateway";	
        gateway.value = "paypal";
        document.paypalcontribution.appendChild(gateway);

    if(monthlyDonation == true) {
      var recurring = document.createElement("input");
      recurring.type = "hidden";
      recurring.name = "recurring_paypal";
      recurring.id = "recurring-hidden";
      recurring.value = "true";
      document.paypalcontribution.appendChild(recurring);
    }
  }

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

  if (i=="ew-pp-eur") {
    paymentType = "pp";
    action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
    var gateway = document.createElement("input");	 
        gateway.type = "hidden";	
        gateway.name = "gateway";	
        gateway.value = "paypal";
        document.paypalcontribution.appendChild(gateway);
    document.getElementsByName("currency_code")[0].value="EUR";
    document.getElementsByName("amountGiven")[0].value="";
    for ( var j = 0; j <  document.getElementsByName("amount").length; j++ ) {
      document.getElementsByName("amount")[j].checked=false;
    }
    if(monthlyDonation == true) {
      var recurring = document.createElement("input");
      recurring.type = "hidden";
      recurring.name = "recurring_paypal";
      recurring.id = "recurring-hidden";
      recurring.value = "true";
      document.paypalcontribution.appendChild(recurring);
    }
  }

  if (i=="ew-rpp") {
    paymentType= "pp";
    action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
    var gateway = document.createElement("input");	 
        gateway.type = "hidden";	
        gateway.name = "gateway";	
        gateway.value = "paypal";
        document.paypalcontribution.appendChild(gateway);

    var recurring = document.createElement("input");
        recurring.type = "hidden";
        recurring.name = "recurring_paypal";
        recurring.id = "recurring-hidden";
        recurring.value = "true";
        document.paypalcontribution.appendChild(recurring);
  }

    if (i=="ew-wm") {
    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 **************************************
  if (i=="ew-yd") {
    paymentType = "ew";
    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|ew-yandex}}}<html>";
  }

  if (i=="ew-mb") {
    paymentType = "ew";
    action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
    var gateway = document.createElement("input");	 
        gateway.type = "hidden";	
        gateway.name = "gateway";	
        gateway.value = "moneybookers";
        document.paypalcontribution.appendChild(gateway);
  }

//**********************************  eWallets *******************************************
//*************************************************** needs to be configured *********************************************

  document.paypalcontribution.action = action_url;

  // ************************Do not change without the permission of Faulkner***************************
  document.paypalcontribution.utm_source.value = getQuerystring( 'utm_source' ) + '.';

  if(getQuerystring( 'template' )=='') {
    document.paypalcontribution.utm_source.value += 'default' + '~';
  }
  else {
    document.paypalcontribution.utm_source.value += getQuerystring( 'template' ).replace("Lp-layout-","") + '~';
  }
  if(getQuerystring( 'appeal-template' )=='') {
    document.paypalcontribution.utm_source.value +=  'default' + '~';
  }
  else {
    document.paypalcontribution.utm_source.value +=  getQuerystring( 'appeal-template' ).replace("Appeal-template-","") + '~';
  }
  if(getQuerystring( 'appeal' )=='') {
    document.paypalcontribution.utm_source.value +=  'default' + '~';
  }
  else {
    document.paypalcontribution.utm_source.value +=  getQuerystring( 'appeal' ).replace("Appeal-","") + '~';
  }
  if(getQuerystring( 'form-template' )=='') {
    document.paypalcontribution.utm_source.value +=  'default' + '~';
  }
  else {
    document.paypalcontribution.utm_source.value +=  getQuerystring( 'form-template' ).replace("Form-template-","") + '~';
  }
  if(getQuerystring( 'form-countryspecific' )=='') {
    document.paypalcontribution.utm_source.value +=  'control';
  }
  else {
    document.paypalcontribution.utm_source.value +=  getQuerystring( 'form-countryspecific' ).replace("Form-countryspecific-","");
  }

  document.paypalcontribution.utm_source.value +=  '.' + paymentType;

   document.paypalcontribution.utm_campaign.value = getQuerystring( 'utm_campaign' );

  //****************************** End Faulkner ******************************************************

  if (i=="ew-pp-usd"||i=="ew-pp-eur") {
    if(typeof(OWA) !== 'undefined') {
      OWATracker.shareStateByPost( document.paypalcontribution );
    }
    document.paypalcontribution.submit();   
  }
  else if (validateForm(document.paypalcontribution)) {
    if(typeof(OWA) !== 'undefined') {
      OWATracker.shareStateByPost( document.paypalcontribution );
    }
    document.paypalcontribution.submit();
  }
}
</script>
</html>
<!-- End of GlobalCollect handling code -->
|
<!-- Start of NON-GlobalCollect handling code -->
<html>
<script type="text/javascript">
function redirectPayment(i) {
  //if i == cc
    var paymentType ="cc";
    var action_url = "https://payments.wikimedia.org/index.php/Special:PayflowProGateway?uselang=</html>{{int:lang}}\x26masthead={{{PF-masthead|none}}}\x26form_name={{{PF-form-name|TwoStepTwoColumnLetter2}}}\x26text_template={{{PF-text-template|2010/JimmyQuote-green}}}\x26language={{int:lang}}\x26ffname={{{PF-ffname}}}<html>";

  if (i=="ew-pp") {
    paymentType = "pp";
    action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
    var gateway = document.createElement("input");	 
        gateway.type = "hidden";	
        gateway.name = "gateway";	
        gateway.value = "paypal";
        document.paypalcontribution.appendChild(gateway);
    }

  if (i=="ew-rpp") {
    paymentType = "pp";
    action_url="https://wikimediafoundation.org/wiki/Special:ContributionTracking/</html>{{int:lang}}<html>";
    var gateway = document.createElement("input");	 
        gateway.type = "hidden";	
        gateway.name = "gateway";	
        gateway.value = "paypal";
        document.paypalcontribution.appendChild(gateway);

    var recurring = document.createElement("input");
        recurring.type = "hidden";
        recurring.name = "recurring_paypal";
        recurring.id = "recurring-hidden";
        recurring.value = "true";
        document.paypalcontribution.appendChild(recurring);
    }
  document.paypalcontribution.action = action_url;

  // ************************Do not change without the permission of Faulkner***************************
  document.paypalcontribution.utm_source.value = getQuerystring( 'utm_source' ) + '.';

  if(getQuerystring( 'template' )=='') {
    document.paypalcontribution.utm_source.value += 'default' + '~';
  }
  else {
    document.paypalcontribution.utm_source.value += getQuerystring( 'template' ).replace("Lp-layout-","") + '~';
  }
  if(getQuerystring( 'appeal-template' )=='') {
    document.paypalcontribution.utm_source.value +=  'default' + '~';
  }
  else {
    document.paypalcontribution.utm_source.value +=  getQuerystring( 'appeal-template' ).replace("Appeal-template-","") + '~';
  }
  if(getQuerystring( 'appeal' )=='') {
    document.paypalcontribution.utm_source.value +=  'default' + '~';
  }
  else {
    document.paypalcontribution.utm_source.value +=  getQuerystring( 'appeal' ).replace("Appeal-","") + '~';
  }
  if(getQuerystring( 'form-template' )=='') {
    document.paypalcontribution.utm_source.value +=  'default' + '~';
  }
  else {
    document.paypalcontribution.utm_source.value +=  getQuerystring( 'form-template' ).replace("Form-template-","") + '~';
  }
  if(getQuerystring( 'form-countryspecific' )=='') {
    document.paypalcontribution.utm_source.value +=  'control';
  }
  else {
    document.paypalcontribution.utm_source.value +=  getQuerystring( 'form-countryspecific' ).replace("Form-countryspecific-","");
  }

  document.paypalcontribution.utm_source.value +=  '.' + paymentType;

   document.paypalcontribution.utm_campaign.value = getQuerystring( 'utm_campaign' );

  //****************************** End Faulkner ******************************************************

  if (validateForm(document.paypalcontribution)) {
    if(typeof(OWA) !== 'undefined') {
      OWATracker.shareStateByPost( document.paypalcontribution );
    }
    document.paypalcontribution.submit();
  }
}
</script>
</html>
<!-- End of NON-GlobalCollect handling code -->
}}</div>