Esempio n. 1
0
        public PaymentResultDisplay CapturePayment(PaymentRequest request)
        {
            var processor = new PaymentProcessor(MerchelloContext, request);

            var capture = processor.Capture();

            var result = new PaymentResultDisplay()
            {
                Success = capture.Payment.Success,
                Invoice = capture.Invoice.ToInvoiceDisplay(),
                Payment = capture.Payment.Result.ToPaymentDisplay(),
                ApproveOrderCreation = capture.ApproveOrderCreation
            };

            if (!capture.Payment.Success)
            {
                capture.Payment.Result.AuditPaymentDeclined();
            }
            else
            {
                capture.Payment.Result.AuditPaymentCaptured(request.Amount);
            }

            return(result);
        }
Esempio n. 2
0
        public PaymentDisplay CapturePayment(PaymentRequest request)
        {
            var processor = new PaymentProcessor(MerchelloContext, request);

            var capture = processor.Capture();

            if (!capture.Payment.Success)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            return(capture.Payment.Result.ToPaymentDisplay());
        }
Esempio n. 3
0
        public PaymentResultDisplay CapturePayment(PaymentRequestDisplay request)
        {
            var processor = new PaymentProcessor(MerchelloContext, request);

            var capture = processor.Capture();

            var result = new PaymentResultDisplay()
            {
                Success = capture.Payment.Success,
                Invoice = capture.Invoice.ToInvoiceDisplay(),
                Payment = capture.Payment.Result.ToPaymentDisplay(),
                ApproveOrderCreation = capture.ApproveOrderCreation
            };

            if (!capture.Payment.Success)
            {
                capture.Payment.Result.AuditPaymentDeclined();
            }
            else
            {
                capture.Payment.Result.AuditPaymentCaptured(request.Amount);
            }

            return result;
        }
Esempio n. 4
0
        /// <summary>
        /// PaymentProcessor.Capture()
        /// </summary>
        public IPaymentResult ComplitePayment(PaymentRequest request)
        {
            var processor = new PaymentProcessor(MerchelloContext, request);

            return(processor.Capture());
        }