public static PaymentStatus validatePayment(Payment payment)
        {
            var vp = new PaymentStatus();

            if (payment.method == "PAYPAL" || payment.useSavedDetails)
            {

                vp.success = true; //paypal always true for now

            }
            else
            {
                vp.success = CardValidator.Validate(payment.method, payment.number);
            }
            if (vp.success == false) // all invalid mean bad card number for now.
            {
                vp.message = "INVALID_CARD_NUMBER";
            }
            return vp;
        }
예제 #2
0
 public ProcessPayment(Payment _payment)
 {
     payment = _payment;
     paymentStatus = new PaymentStatus();
     paymentEndPoint = new PaymentEndPoint().paymentService;
 }
예제 #3
0
 private void validate()
 {
     paymentStatus = PaymentValidator.validatePayment(payment);
 }