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

From Donate
Jump to navigation Jump to search
(changes Matt suggested)
Line 8: Line 8:
 
<script>
 
<script>
 
function redirectPayment (legacyPaymentMethod) {
 
function redirectPayment (legacyPaymentMethod) {
// wrapper for redirectPayment2()
+
// wrapper for new function
 
// using old method parameters
 
// using old method parameters
 
// until buttons can be updated
 
// until buttons can be updated
Line 14: Line 14:
 
switch (legacyPaymentMethod) {
 
switch (legacyPaymentMethod) {
 
case 'cc':
 
case 'cc':
redirectPayment2('cc');
+
mw.donationForm.redirectPaymentWithSubMethod('cc');
 
break;
 
break;
   
Line 23: Line 23:
 
case 'ew-pp-usd':
 
case 'ew-pp-usd':
 
case 'ew-pp-eur':
 
case 'ew-pp-eur':
redirectPayment2('paypal');
+
mw.donationForm.redirectPaymentWithSubMethod('paypal');
 
break;
 
break;
   
 
case 'dd':
 
case 'dd':
redirectPayment2('dd');
+
mw.donationForm.redirectPaymentWithSubMethod('dd');
 
break;
 
break;
   
 
case 'rtbt-id':
 
case 'rtbt-id':
redirectPayment2('rtbt', 'rtbt_ideal');
+
mw.donationForm.redirectPaymentWithSubMethod('rtbt', 'rtbt_ideal');
 
break;
 
break;
   
 
case 'ew-yd':
 
case 'ew-yd':
redirectPayment2('ew', 'ew_yandex');
+
mw.donationForm.redirectPaymentWithSubMethod('ew', 'ew_yandex');
 
break;
 
break;
   
 
case 'rtbt-sf':
 
case 'rtbt-sf':
redirectPayment2('rtbt', 'rtbt_sofortuberweisung');
+
mw.donationForm.redirectPaymentWithSubMethod('rtbt', 'rtbt_sofortuberweisung');
 
break;
 
break;
   
 
case 'ew-amazon':
 
case 'ew-amazon':
redirectPayment2('amazon');
+
mw.donationForm.redirectPaymentWithSubMethod('amazon');
 
break;
 
break;
   
 
case 'obt-bp':
 
case 'obt-bp':
redirectPayment2('obt', 'bpay');
+
mw.donationForm.redirectPaymentWithSubMethod('obt', 'bpay');
 
break;
 
break;
   
 
case 'ew-wm':
 
case 'ew-wm':
redirectPayment2('ew', 'ew_webmoney');
+
mw.donationForm.redirectPaymentWithSubMethod('ew', 'ew_webmoney');
 
break;
 
break;
   
 
case 'cash-bl':
 
case 'cash-bl':
redirectPayment2('cash', 'boleto');
+
mw.donationForm.redirectPaymentWithSubMethod('cash', 'boleto');
 
break;
 
break;
   
 
case 'rtbt-en':
 
case 'rtbt-en':
redirectPayment2('rtbt', 'rtbt_enets');
+
mw.donationForm.redirectPaymentWithSubMethod('rtbt', 'rtbt_enets');
 
break;
 
break;
 
}
 
}
Line 65: Line 65:
 
}
 
}
   
function redirectPayment2(paymentMethod, paymentSubMethod) {
+
mw.donationForm.redirectPaymentWithSubMethod = function(paymentMethod, paymentSubMethod) {
   
 
// set up inputs
 
// set up inputs
Line 98: Line 98:
 
if( frequency !== 'monthly' ){
 
if( frequency !== 'monthly' ){
 
frequency = 'onetime';
 
frequency = 'onetime';
  +
params['recurring'] = 'false';
 
} else {
 
} else {
 
params['recurring'] = 'true';
 
params['recurring'] = 'true';
Line 110: Line 111:
 
}
 
}
   
addAnalytics();
+
mw.donationForm.addAnalytics();
 
 
 
if (validateForm(form)) {
 
if (validateForm(form)) {
Line 118: Line 119:
 
}
 
}
   
function addAnalytics () {
+
mw.donationForm.addAnalytics = function() {
 
// stuffs parameters into utm_source to make them available for analytics
 
// stuffs parameters into utm_source to make them available for analytics
   

Revision as of 12:28, 23 October 2013