Template:2012FR/Form-section/Processing/Default: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
rename redirectPayment, add way to skip validation (for USD methods where there's no need to select an amount) |
remove paypal_ec override for Japan, it's default everywhere now |
||
(17 intermediate revisions by 2 users not shown) | |||
Line 4:
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 === 'cc-wp' ) {
form.payment_method.value = 'cc';
form.gateway.value = 'worldpay';
form.ffname.value = 'worldpay';
}
if( paymentMethod === 'cc-adyen' ) {
form.payment_method.value = 'cc';
form.gateway.value = 'adyen';
form.ffname.value = 'adyen';
}
var frequency = $("input[name='frequency']:checked").val();
if( frequency !== 'monthly' ){
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();
}
};
donationForm.addAnalytics = function() {
Line 153 ⟶ 108:
}
form.utm_campaign.value = getQuerystring( 'utm_campaign' );
};
donationForm.toggleMonthly = function(monthly) {
Line 163 ⟶ 117:
$('#form-wrapper').removeClass('form-monthly');
}
};
</script>
</html>
|
Revision as of 18:19, 8 March 2018