You can pass a format string to $card->getExpiryDate() and avoid the str_pad here