I have a problem, I have a function that, when I pass the card number, returns the name of the flag (visa, mastercard etc)
And I need to return the flag name inside a static function
$bandeira = getBandeiraByNumber("55523131232131"); retorna string visa
$card->setCreditCardBrand(\Gateway\One\DataContract\Enum\CreditCardBrandEnum::$bandeira);
Here's the move
CreditCardBrandEnum::$bandeira
It returns this error
Fatal error: Access to undeclared static property: Gateway\One\DataContract\Enum\CreditCardBrandEnum::$bandeira in /var/www/html/exec/mundipagg/Mundipagg.php on line 148
Abstract class is like this.
Gateway \ One \ DataContract \ Enum; namespace
abstract class CreditCardBrandEnum
{
const VISA = 'Visa';
const MASTERCARD = 'Mastercard';
const HIPERCARD = 'Hipercard';
const AMEX = 'Amex';
const DINERS = 'Diners';
const ELO = 'Elo';
const AURA = 'Aura';
const DISCOVER = 'Discover';
const CASASHOW = 'CasaShow';
const HAVAN = 'Havan';
const HUGCARD = 'HugCard';
const ANDARAKI = 'AndarAki';
const LEADERCARD = 'LearderCard';
}
In case I want to transform a variable into const static, but I'm not getting it.