From 8bf11c13d18feba5001cf24bb67df8adc6726b2c Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 31 Aug 2015 21:28:04 +0530 Subject: [PATCH] --CRM-16542, fixed code for form rule for Paypal Express --- CRM/Core/Payment/ProcessorForm.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Payment/ProcessorForm.php b/CRM/Core/Payment/ProcessorForm.php index f29b28581c..9baed6cc8f 100644 --- a/CRM/Core/Payment/ProcessorForm.php +++ b/CRM/Core/Payment/ProcessorForm.php @@ -110,10 +110,13 @@ class CRM_Core_Payment_ProcessorForm { //@todo document why this addHidden is here //CRM-15743 - we should not set/create hidden element for pay later // because payment processor is not selected - if (!empty($form->_paymentProcessorID)) { + $processorId = $form->getVar('_paymentProcessorID'); + $isBillingAddressRequiredForPayLater = $form->_isBillingAddressRequiredForPayLater; + if (!empty($processorId)) { + $isBillingAddressRequiredForPayLater = FALSE; $form->addElement('hidden', 'hidden_processor', 1); } - CRM_Core_Payment_Form::buildPaymentForm($form, $form->_paymentProcessor, empty($form->_isBillingAddressRequiredForPayLater), FALSE); + CRM_Core_Payment_Form::buildPaymentForm($form, $form->_paymentProcessor, empty($isBillingAddressRequiredForPayLater), FALSE); } } -- 2.25.1