Omnipay\Common\CreditCard::getSupportedBrands PHP Метод

getSupportedBrands() публичный Метод

Note: The fact that this class knows about a particular card brand does not imply that your gateway supports it.
См. также: self::$supported_cards
public getSupportedBrands ( ) : array
Результат array
    public function getSupportedBrands()
    {
        return $this->supported_cards;
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function getConfigTreeBuilder()
 {
     $builder = new TreeBuilder();
     $rootNode = $builder->root('sylius_omnipay');
     $gateways = GatewayFactory::find();
     $omnipayCc = new CreditCard();
     $ccTypes = array_keys($omnipayCc->getSupportedBrands());
     $rootNode->children()->arrayNode('gateways')->useAttributeAsKey('name')->prototype('array')->children()->scalarNode('type')->validate()->ifTrue(function ($type) use($gateways) {
         if (empty($type)) {
             return true;
         }
         if (0 !== strpos($type, '\\') && !in_array($type, $gateways)) {
             return true;
         }
         return false;
     })->thenInvalid(sprintf('Unknown payment gateway selected. Valid gateways are: %s.', implode(", ", $gateways)))->end()->end()->scalarNode('label')->cannotBeEmpty()->end()->booleanNode('mode')->defaultFalse()->end()->booleanNode('active')->defaultTrue()->end()->arrayNode('cc_types')->prototype('scalar')->validate()->ifTrue(function ($ccType) use($ccTypes) {
         if (empty($ccType)) {
             return true;
         }
         if (!in_array($ccType, $ccTypes)) {
             return true;
         }
         return false;
     })->thenInvalid(sprintf('Unknown credit card type selected. Valid credit card types are: %s.', implode(", ", $ccTypes)))->end()->end()->end()->arrayNode('options')->prototype('scalar')->end()->end()->end()->end()->end();
     return $builder;
 }
All Usage Examples Of Omnipay\Common\CreditCard::getSupportedBrands
CreditCard