CRM-20516: Card type widget appears on front end when a different processor selected
authordeb.monish <monish.deb@jmaconsulting.biz>
Thu, 18 May 2017 08:47:01 +0000 (14:17 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Thu, 18 May 2017 08:47:01 +0000 (14:17 +0530)
CRM/Financial/Form/Payment.php

index 996e45abc040e2077910694730e4ce0ffe9d56e1..69ee45401d8f4df33e78df0574e22947ddb7963d 100644 (file)
@@ -113,10 +113,12 @@ class CRM_Financial_Form_Payment extends CRM_Core_Form {
     $creditCards = CRM_Financial_BAO_PaymentProcessor::getCreditCards($paymentProcessorID);
     $creditCardTypes = CRM_Core_Payment_Form::getCreditCardCSSNames($creditCards);
     CRM_Core_Resources::singleton()
-      ->addScriptFile('civicrm', 'templates/CRM/Core/BillingBlock.js', 10, 'html-header', FALSE)
+      // CRM-20516: add BillingBlock script on billing-block region
+      //  to support this feature in payment form snippet too.
+      ->addScriptFile('civicrm', 'templates/CRM/Core/BillingBlock.js', 10, 'billing-block', FALSE)
       // workaround for CRM-13634
       // ->addSetting(array('config' => array('creditCardTypes' => $creditCardTypes)));
-      ->addScript('CRM.config.creditCardTypes = ' . json_encode($creditCardTypes) . ';', '-9999', 'html-header');
+      ->addScript('CRM.config.creditCardTypes = ' . json_encode($creditCardTypes) . ';', '-9999', 'billing-block');
   }
 
 }