Commit a444f2e3 authored by mattwire's avatar mattwire
Browse files

Add getPaymentProcessorSelectorValue function to CRM.payment

parent 859176e8
......@@ -190,6 +190,26 @@
return billingName;
},
/**
* Get the selected payment processor on the form
* @returns {null|number}
*/
getPaymentProcessorSelectorValue: function() {
// Frontend radio selector
var paymentProcessorSelected = form.querySelector('input[name="payment_processor_id"]:checked');
if (paymentProcessorSelected !== null) {
return parseInt(paymentProcessorSelected.value);
}
else {
// Backend select dropdown
paymentProcessorSelected = form.querySelector('select[name="payment_processor_id"]');
if (paymentProcessorSelected !== null) {
return parseInt(paymentProcessorSelected.value);
}
}
return null;
},
/**
* Is the AJAX request a payment form?
* @param {string} url
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment