I added a few more classes with constant values, so instead of writing this :
$draftCardRegistration = new CardRegistration();
$draftCardRegistration->Currency = CurrencyIso::EUR; // ← constant already existed for this one
$draftCardRegistration->CardType = 'CB_VISA_MASTERCARD'; // ← but not for that one
we can use the dedicated constants :
$cardRegistration = new CardRegistration();
$cardRegistration->Currency = CurrencyIso::EUR;
$cardRegistration->CardType = CardType::CbVisaMastercard;
This will avoid keeping hardcoded values in the logic, avoid risks of typographical error, and improve clarity by showing the possible values for a parameter.
I used the official documentation, which often gives types and possible values, although those types didn’t exist yet in the SDK:
I added a few more classes with constant values, so instead of writing this :
we can use the dedicated constants :
This will avoid keeping hardcoded values in the logic, avoid risks of typographical error, and improve clarity by showing the possible values for a parameter.
I used the official documentation, which often gives types and possible values, although those types didn’t exist yet in the SDK: