1
Guys I’m having a problem, I have function that when passing card number returns the flag name (visa, Maxcard etc)
And I need to return the flag name within a Statica function
$bandeira = getBandeiraByNumber("55523131232131"); retorna string visa
$card->setCreditCardBrand(\Gateway\One\DataContract\Enum\CreditCardBrandEnum::$bandeira);
Here is the play
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.
namespace Gateway One Datacontract Enum;
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 turn a variable into const Static, but I’m not getting it.
What he tries to read is
\Gateway\One\DataContract\Enum\CreditCardBrandEnum::visa
Does this exist in the class? See the constant capitalization too, if possible add to the question.– rray
@rray yes there is, I re-edited. da a look
– TutiJapa Wada