We are now building payment options on our .net MVC app. Up to now we have successfully linked paymant with Paypal options, but now we are at the stade of introducing and testing credit card options.
So we are wondering if it is safe, even temporarily, to host and use credit card information?
I am building a viewModel which will look like this:
public class CreditCardViewModel
{
public int CardNumber { get; set; }
public int ExpireMonth { get; set; }
public int ExpireYear { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
A new one will be generated in a get view, and then posted back, and once the informations are validated, using PayPal Integration, we are planning to take along the payment method. But I want to protect users from getting spammed, hacked or stolen, and thus am wondering if it is a safe / good approach, or if the StackOverflow community will advise me to take another route...
EDIT I have edited my view model a bit, it looks like this:
public class CreditCardViewModel
{
[Required]
public SecureString CardNumber { get; set; }
[Required]
[Range(1, 12, ErrorMessage = "Invalid Month Number")]
public int ExpireMonth { get; set; }
[Required]
public int ExpireYear { get; set; }
[Required]
public string FirstName { get; set; }
[Required]
public string LastName { get; set; }
}
And, as mentioned, the data used will not be saved in the database. It will be used one time in the POST
method.
EDIT As per Juliano and Chris Pratt's great explanations, I have decided to remove the model from the web site and explore different avenues (mainly exploring the Merchant SDK integration). But thanks for the great explanations folks, because I did not know such compliancy existed.