コード例 #1
0
        private static EncryptedPaymentInformation EncryptData(PaymentInformation paymentInformation)
        {
            EncryptedPaymentInformation encryptedPaymentInformation = new EncryptedPaymentInformation();
            CryptographyService         cryptographyService         = new CryptographyService();

            encryptedPaymentInformation.CardNo   = cryptographyService.EncryptText(paymentInformation.CardNo);
            encryptedPaymentInformation.Expiry   = cryptographyService.EncryptText(paymentInformation.Expiry);
            encryptedPaymentInformation.Amount   = cryptographyService.EncryptText(paymentInformation.Amount.ToString());
            encryptedPaymentInformation.Currency = cryptographyService.EncryptText(paymentInformation.Currency);
            encryptedPaymentInformation.CVV      = cryptographyService.EncryptText(paymentInformation.CVV);
            return(encryptedPaymentInformation);
        }
コード例 #2
0
        public void EncryptTextTest()
        {
            string f = "COMMON";
            CryptographyService cryptographyService = new CryptographyService();
            string result = cryptographyService.EncryptText(f);

            Assert.IsNotNull(result);
        }