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

Content deleted Content added
stop using dotted payment method
No edit summary
Line 8:
 
donationForm.redirectPayment = function(paymentMethod, paymentSubMethod, skipValidation) {
 
if (typeof paymentSubMethod !== 'undefined' ) {
paymentMethodpaymentSubMethod = 'cc';
}
var form = document.paypalcontribution; // we should really change this some day
var paymentsURL = 'https://payments.wikimedia.org/index.php/Special:GatewayFormChooser';
 
form.action = paymentsURL + '?' + $.param(params);
 
// set up inputs
documentform.getElementsByName("currency_code")[0].value = '</html>{{{currency|USD}}}<html>';
 
if (typeof paymentSubMethod == 'undefined') {
paymentSubMethod = '';
}
var form = document.paypalcontribution; // we should really change this some day
var paymentsURL = 'https://payments.wikimedia.org/index.php/Special:GatewayFormChooser';
var params = {
'uselang' : $("input[name='language']").val(),
'language' : $("input[name='language']").val(),
'currency_code' : $("input[name='currency_code']").val(),
'country' : $("input[name='country']").val(),
'paymentmethod' : paymentMethod
};
if( paymentSubMethod != '' ){
params['submethod'] = paymentSubMethod;
params['payment_submethod'] = paymentSubMethod;
}
// Testing for Adyen
if( paymentMethod === 'adyen-cc' ) {
paymentMethod = 'cc';
params.paymentmethod = 'cc';
params.gateway = 'adyen';
}
 
// WorldpayWorldPay override for cc
if( paymentMethod === 'cc-wp' ) {
paymentMethod = 'cc';
paramsform.paymentmethodpayment_method.value = 'cc';
paramsform.gateway.value = 'worldpay';
paramsform.ffname .value = 'worldpay';
};
// Adyen override for cc
if( paymentMethod === 'adyen-cc-adyen' ) {
params.paymentmethodpaymentMethod = 'cc';
form.payment_method.value = 'cc';
paramsform.gateway.value = 'adyen';
form.ffname.value = 'adyen';
}
Line 49 ⟶ 43:
if( frequency !== 'monthly' ){
frequency = 'onetime';
// commented out below as it breaks eNETS for some reason
// params['recurring'] = 'false';
} else {
params['form.recurring'].value = 'true';
// the following causes tons of errors. Don't.
// paymentMethod = 'r' + paymentMethod;
}
form.action = paymentsURL + '?' + $.param(params);
form.payment_method.value = paymentMethod;
params['submethod']form.payment_submethod.value = paymentSubMethod;
 
donationForm.addAnalytics();
 
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 += '.' + form.payment_method.valuefull_dotted_payment_method;
if ( skipValidation || validateForm(form) ) {
form.method = "POSTGET";
form.submit();
}
Line 105:
}
 
form.utm_source.value += '.' + form.payment_method.value;
form.utm_campaign.value = getQuerystring( 'utm_campaign' );
};