Template:2012FR/Form-section/Processing/Default: Difference between revisions
Content deleted Content added
explicitly set recurring=false if needed |
only mess with form after validating |
||
Line 9:
donationForm.redirectPayment = function(paymentMethod, paymentSubMethod, skipValidation) {
if (
paymentSubMethod = '';▼
} ▼
var form = document.paypalcontribution; // we should really change this some day▼
var paymentsURL = 'https://payments.wikimedia.org/index.php/Special:GatewayFormChooser';▼
if (typeof paymentSubMethod == 'undefined') {▼
form.action = paymentsURL;▼
▲ paymentSubMethod = '';
▲ var form = document.paypalcontribution; // we should really change this some day
▲ var paymentsURL = 'https://payments.wikimedia.org/index.php/Special:GatewayFormChooser';
▲ form.action = paymentsURL;
// set up inputs▼
▲ // set up inputs
▲ if (typeof paymentSubMethod == 'undefined') {
}▼
if (typeof paymentSubMethod == 'undefined') {▼
// WorldPay override for cc▼
paymentSubMethod = '';
if( paymentMethod === 'cc-wp' ) {▼
form.payment_method.value = 'cc';▼
form.gateway.value = 'worldpay';▼
form.ffname.value = 'worldpay';▼
}▼
// Adyen override for cc▼
if( paymentMethod === 'cc-adyen' ) {▼
paymentMethod = 'cc';▼
form.payment_method.value = 'cc';▼
form.gateway.value = 'adyen';▼
form.ffname.value = 'adyen';▼
}▼
var frequency = $("input[name='frequency']:checked").val();▼
if( frequency !== 'monthly' ){▼
frequency = 'onetime';▼
form.recurring.value = 'false';▼
} else {▼
form.recurring.value = 'true';▼
form.payment_method.value = paymentMethod;▼
form.payment_submethod.value = paymentSubMethod;▼
▲ // WorldPay override for cc
donationForm.addAnalytics();▼
▲ if( paymentMethod === 'cc-wp' ) {
▲ form.payment_method.value = 'cc';
▲ form.gateway.value = 'worldpay';
▲ form.ffname.value = 'worldpay';
▲ }
▲ // Adyen override for cc
var full_dotted_payment_method = paymentMethod;▼
▲ paymentMethod = 'cc';
full_dotted_payment_method = 'r' + full_dotted_payment_method;▼
▲ form.payment_method.value = 'cc';
▲ form.gateway.value = 'adyen';
▲ if ( paymentSubMethod ) {
}
▲ var frequency = $("input[name='frequency']:checked").val();
▲ if( frequency !== 'monthly' ){
▲ frequency = 'onetime';
▲ } else {
▲ }
▲ form.payment_method.value = paymentMethod;
▲ form.payment_submethod.value = paymentSubMethod;
▲ donationForm.addAnalytics();
▲ var full_dotted_payment_method = paymentMethod;
▲ full_dotted_payment_method = 'r' + full_dotted_payment_method;
▲ }
if ( paymentSubMethod ) {
full_dotted_payment_method = form.payment_method.value + '.' + paymentSubMethod;
▲ }
form.utm_source.value += '.' + full_dotted_payment_method;▼
▲ form.utm_source.value += '.' + full_dotted_payment_method;
form.method = "GET";
form.submit();
|