コード例 #1
0
        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);
 }