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); }
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()); }
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; }
/// <summary> /// PaymentProcessor.Capture() /// </summary> public IPaymentResult ComplitePayment(PaymentRequest request) { var processor = new PaymentProcessor(MerchelloContext, request); return(processor.Capture()); }