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

From Donate
Jump to navigation Jump to search
Content deleted Content added
Khorn (WMF) (talk | contribs)
No edit summary
rename redirectPayment, add way to skip validation (for USD methods where there's no need to select an amount)
Line 10: Line 10:
switch (legacyPaymentMethod) {
switch (legacyPaymentMethod) {
case 'cc':
case 'cc':
donationForm.redirectPaymentWithSubMethod('cc');
donationForm.redirectPayment('cc');
break;
break;


Line 19: Line 19:
case 'ew-pp-usd':
case 'ew-pp-usd':
case 'ew-pp-eur':
case 'ew-pp-eur':
donationForm.redirectPaymentWithSubMethod('paypal');
donationForm.redirectPayment('paypal');
break;
break;


case 'dd':
case 'dd':
donationForm.redirectPaymentWithSubMethod('dd');
donationForm.redirectPayment('dd');
break;
break;


case 'rtbt-id':
case 'rtbt-id':
donationForm.redirectPaymentWithSubMethod('rtbt', 'rtbt_ideal');
donationForm.redirectPayment('rtbt', 'rtbt_ideal');
break;
break;


case 'ew-yd':
case 'ew-yd':
donationForm.redirectPaymentWithSubMethod('ew', 'ew_yandex');
donationForm.redirectPayment('ew', 'ew_yandex');
break;
break;


case 'rtbt-sf':
case 'rtbt-sf':
donationForm.redirectPaymentWithSubMethod('rtbt', 'rtbt_sofortuberweisung');
donationForm.redirectPayment('rtbt', 'rtbt_sofortuberweisung');
break;
break;


case 'ew-amazon':
case 'ew-amazon':
donationForm.redirectPaymentWithSubMethod('amazon');
donationForm.redirectPayment('amazon');
break;
break;


case 'obt-bp':
case 'obt-bp':
donationForm.redirectPaymentWithSubMethod('obt', 'bpay');
donationForm.redirectPayment('obt', 'bpay');
break;
break;


case 'ew-wm':
case 'ew-wm':
donationForm.redirectPaymentWithSubMethod('ew', 'ew_webmoney');
donationForm.redirectPayment('ew', 'ew_webmoney');
break;
break;


case 'cash-bl':
case 'cash-bl':
donationForm.redirectPaymentWithSubMethod('cash', 'boleto');
donationForm.redirectPayment('cash', 'boleto');
break;
break;


case 'rtbt-en':
case 'rtbt-en':
donationForm.redirectPaymentWithSubMethod('rtbt', 'rtbt_enets');
donationForm.redirectPayment('rtbt', 'rtbt_enets');
break;
break;
}
}
Line 61: Line 61:
}
}


donationForm.redirectPaymentWithSubMethod = function(paymentMethod, paymentSubMethod) {
donationForm.redirectPayment = function(paymentMethod, paymentSubMethod, skipValidation) {


// set up inputs
// set up inputs
Line 110: Line 110:
donationForm.addAnalytics();
donationForm.addAnalytics();
if (validateForm(form)) {
if (validateForm(form) || skipValidation) {
form.method = "POST";
form.method = "POST";
form.submit();
form.submit();

Revision as of 13:47, 6 January 2014