$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');
}
}