Skip to content
Snippets Groups Projects
Commit d379b236 authored by Richard Burton's avatar Richard Burton
Browse files

validateForm update

parent 2f045330
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,9 @@
$('form.webform-client-form').addClass('stripe-payment-form');
}
else {
$('#crm-container>form').addClass('stripe-payment-form');
if (!($('.stripe-payment-form').length)) {
$('#crm-container>form').addClass('stripe-payment-form');
}
}
$form = $('form.stripe-payment-form');
if (isWebform) {
......
......@@ -123,7 +123,8 @@ function stripe_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
* @param $errors - Reference to the errors array.
*/
function stripe_civicrm_validateForm($formName, &$fields, &$files, &$form, &$errors) {
if (isset($form->_paymentProcessor['payment_processor_type']) && $form->_paymentProcessor['payment_processor_type'] == 'Stripe') {
if ((isset($form->_paymentProcessor['payment_processor_type']) &&$form->_paymentProcessor['payment_processor_type'] == 'Stripe')
|| (!isset($form->_paymentProcessor['payment_processor_type']) && isset($form->_elementIndex['stripe_token']))) {
if($form->elementExists('credit_card_number')){
$cc_field = $form->getElement('credit_card_number');
$form->removeElement('credit_card_number', true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment