-
- // Add JS to show icons for the accepted credit cards
- // the credit card pseudo constant results only the CC label, not the key ID
- // so we normalize the name to use it as a CSS class.
- $creditCardTypes = array();
- foreach (CRM_Contribute_PseudoConstant::creditCard() as $key => $name) {
- // Replace anything not css-friendly by an underscore
- // Non-latin names will not like this, but so many things are wrong with
- // the credit-card type configurations already.
- $key = str_replace(' ', '', $key);
- $key = preg_replace('/[^a-zA-Z0-9]/', '_', $key);
- $key = strtolower($key);
- $creditCardTypes[$key] = $name;
- }
-
- CRM_Core_Resources::singleton()
- ->addSetting(array('config' => array('creditCardTypes' => $creditCardTypes)))
- ->addScriptFile('civicrm', 'templates/CRM/Core/BillingBlock.js', 10, 'billing-block');