When it comes to encrypting credit cards numbers (or any string of fixed length) my recommendation would be to use Format-Preserving Encryption. As the name implies, the goal of a Format-Preserving Encryption scheme is to securely encrypt while preserving the original formatting of the plaintext data. In a nutshell, a 16-digit cc number can encrypt to a 16-digit number, so the encrypted length is the same.
In contrast, encrypting using AES-128 in ECB mode the resulting ciphertext will be 64 bits. Another disadvantage is that identical plaintext blocks are encrypted into identical ciphertext blocks; thus it does not hide patterns well.
It's hard to give examples of implementation since your environment and intent were not included in the question but again, if you are wanting to encrypt cc numbers which can then be used as plaintext, Format-Preserving Encryption is your best bet.