Skip to content

Commit

Permalink
Merge pull request #18475 from seamuslee001/5.29
Browse files Browse the repository at this point in the history
dev/financial#147 Ensure that jQuery Validation doesn't execute when …
  • Loading branch information
seamuslee001 authored Sep 16, 2020
2 parents c78bd17 + 11d000e commit e3e81d5
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions CRM/Core/Payment/PayPalImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,22 @@ protected function addPaypalExpressCode(&$form) {
$form->_expressButtonName = $form->getButtonName('upload', 'express');
}
$form->assign('expressButtonName', $form->_expressButtonName);
$form->add(
'image',
$form->_expressButtonName,
$this->_paymentProcessor['url_button'],
['class' => 'crm-form-submit']
);
$form->add('xbutton', $form->_expressButtonName, ts('Pay using PayPal'), [
'type' => 'submit',
'formnovalidate' => 'formnovalidate',
'class' => 'crm-form-submit',
]);
CRM_Core_Resources::singleton()->addStyle('
button#' . $form->_expressButtonName . '{
background-image: url(' . $this->_paymentProcessor['url_button'] . ');
color: transparent;
background-repeat: no-repeat;
background-color: transparent;
background-position: center;
min-width: 150px;
min-height: 50px;
border: none;
');
}
}

Expand Down Expand Up @@ -1109,7 +1119,6 @@ protected function isPaypalExpress($params) {
if ($this->isPayPalType($this::PAYPAL_EXPRESS)) {
return TRUE;
}

// This would occur postProcess.
if (!empty($params['token'])) {
return TRUE;
Expand All @@ -1123,6 +1132,7 @@ protected function isPaypalExpress($params) {
$possibleExpressFields = [
'_qf_Register_upload_express_x',
'_qf_Payment_upload_express_x',
'_qf_Main_upload_express',
];
if (array_intersect_key($params, array_fill_keys($possibleExpressFields, 1))) {
return TRUE;
Expand Down

0 comments on commit e3e81d5

Please sign in to comment.