コード例 #1
0
        public void Should_MaskSixNumbersOfSixteenDigitCardNumber()
        {
            // arrange
            var expectedCardNumber = "012345******6543";
            var cardNumber         = "0123456789876543";

            // act
            var maskedNumber = CardMaskingUtility.Mask(cardNumber);

            // assert
            maskedNumber.Should().Be(expectedCardNumber);
        }
コード例 #2
0
 private static ApiTransaction BuildTransactionResponse(PaymentTransaction paymentTransaction)
 {
     return(new ApiTransaction
     {
         Id = paymentTransaction.Id,
         Amount = paymentTransaction.Amount,
         CurrencyCode = paymentTransaction.CurrencyCode,
         Number = CardMaskingUtility.Mask(paymentTransaction.Card.Number),
         ExpiryMonth = paymentTransaction.Card.ExpiryMonth,
         ExpiryYear = paymentTransaction.Card.ExpiryYear,
         Status = paymentTransaction.Status.ToString(),
         StatusCode = paymentTransaction.Status,
         Message = paymentTransaction.Message
     });
 }