public bool SupportsCardType(PaymentCardType cardType)
 {
     switch (cardType)
     {
         case PaymentCardType.VisaCredit:
         case PaymentCardType.VisaDebit:
         case PaymentCardType.VisaElectron:
         case PaymentCardType.MasterCard:
         case PaymentCardType.Maestro:
         case PaymentCardType.JcbCard:
         case PaymentCardType.Laser:
         case PaymentCardType.Solo:
         case PaymentCardType.AmericanExpress:
             return true;
         default :
             return false;
     }
 }
Exemple #2
0
 public CancelRuleType()
 {
     this._tPA_Extensions = new TPA_ExtensionsType();
     this._paymentCard    = new PaymentCardType();
 }
 /// <summary>
 /// Get card type
 /// </summary>
 /// <param name="cardType"></param>
 /// <returns></returns>
 private static string GetCardType(PaymentCardType cardType)
 {
     switch (cardType)
     {
         case PaymentCardType.VisaCredit :
             return "VISA";
         case PaymentCardType.VisaDebit :
             return "DELTA";
         case PaymentCardType.VisaElectron :
             return "UKE";
         case PaymentCardType.MasterCard :
             return "MC";
         case PaymentCardType.Maestro :
             return "MAESTRO";
         case PaymentCardType.AmericanExpress :
             return "AMEX";
         case PaymentCardType.DinersClub :
             return "DC";
         case PaymentCardType.JcbCard :
             return "JCB";
         case PaymentCardType.Laser :
             return "LASER";
         case PaymentCardType.Solo :
             return "SOLO";
         default :
             throw new NotSupportedException(string.Format("The card type '{0}' is not currently supported by the SagePay payment gateway.", cardType));
     }
 }
        public void WhenNumberIsValid_ThenSetType(string number, PaymentCardType type)
        {
            var sut = new PaymentCardNumber(number);

            Assert.That(sut.Type, Is.EqualTo(type));
        }