Template:2012FR/Form-section/Processing/Default: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
remove paypal_ec override for Japan, it's default everywhere now |
||
(30 intermediate revisions by 3 users not shown) | |||
Line 1:
<html>
<script>
var donationForm = {};
function redirectPayment (legacyPaymentMethod) {
return undefined;
}
donationForm.redirectPayment = function(paymentMethod, paymentSubMethod, skipValidation) {
var form = document.paypalcontribution; // we should really change this some day
if ( skipValidation || validateForm(form) ) {
var paymentsURL = 'https://payments.wikimedia.org/index.php/Special:GatewayFormChooser';
form.currency_code.value = '</html>{{{currency|USD}}}<html>';
if( paymentMethod ===
form.payment_method.value = 'cc';
form.gateway.value = 'worldpay';
form.ffname.value = 'worldpay';
}
if( paymentMethod ===
form.payment_method.value = 'cc';
form.gateway.value = 'adyen';
form.ffname.value = 'adyen';
}
var frequency = $("input[name='frequency']:checked").val();
if( frequency !==
form.recurring.value = 'false';
} else {
form.recurring.value = 'true';
}
form.payment_method.value = paymentMethod;
form.payment_submethod.value = paymentSubMethod;
var full_dotted_payment_method = paymentMethod;
if ( form.recurring.value == 'true' ) {
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.method = "GET";
form.submit();
}
};
// stuffs parameters into utm_source to make them available for analytics
Line 156 ⟶ 108:
}
form.utm_campaign.value = getQuerystring( 'utm_campaign' );
};
donationForm.toggleMonthly = function(monthly) {
if (monthly) {
$('#form-wrapper').addClass('form-monthly');
} else {
$('#form-wrapper').removeClass('form-monthly');
}
};
</script>
</html>
|
Revision as of 18:19, 8 March 2018