Ejemplo n.º 1
0
        /// <summary>
        /// Captures payment
        /// </summary>
        /// <param name="capturePaymentRequest">Capture payment request</param>
        /// <returns>Capture payment result</returns>
        public virtual CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest)
        {
            var paymentMethod = LoadPaymentMethodBySystemName(capturePaymentRequest.Order.PaymentMethodSystemName);

            if (paymentMethod == null)
            {
                throw new SmartException("Payment method couldn't be loaded");
            }

            try
            {
                return(paymentMethod.Value.Capture(capturePaymentRequest));
            }
            catch (NotSupportedException)
            {
                var result = new CapturePaymentResult();
                result.AddError(_localizationService.GetResource("Common.Payment.NoCaptureSupport"));
                return(result);
            }
            catch
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Captures payment
        /// </summary>
        /// <param name="capturePaymentRequest">Capture payment request</param>
        /// <returns>Capture payment result</returns>
        public virtual CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest)
        {
            var paymentMethod = LoadPaymentMethodBySystemName(capturePaymentRequest.Order.PaymentMethodSystemName);

            if (paymentMethod == null)
            {
                throw new SmartException(T("Payment.CouldNotLoadMethod"));
            }

            try
            {
                return(paymentMethod.Value.Capture(capturePaymentRequest));
            }
            catch (NotSupportedException)
            {
                var result = new CapturePaymentResult();
                result.AddError(T("Common.Payment.NoCaptureSupport"));
                return(result);
            }
            catch
            {
                throw;
            }
        }
        /// <summary>
        /// Captures payment
        /// </summary>
        /// <param name="capturePaymentRequest">Capture payment request</param>
        /// <returns>Capture payment result</returns>
        public virtual CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest)
        {
            var paymentMethod = LoadPaymentMethodBySystemName(capturePaymentRequest.Order.PaymentMethodSystemName);
            if (paymentMethod == null)
                throw new SmartException("Payment method couldn't be loaded");

			try
			{
				return paymentMethod.Value.Capture(capturePaymentRequest);
			}
			catch (NotSupportedException)
			{
				var result = new CapturePaymentResult();
				result.AddError(_localizationService.GetResource("Common.Payment.NoCaptureSupport"));
				return result;
			}
			catch
			{
				throw;
			}
        }
		/// <summary>
		/// Captures payment
		/// </summary>
		/// <param name="capturePaymentRequest">Capture payment request</param>
		/// <returns>Capture payment result</returns>
		public virtual CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest)
		{
			var result = new CapturePaymentResult();
			result.AddError(T("Common.Payment.NoCaptureSupport"));
			return result;
		}
        /// <summary>
        /// Captures payment
        /// </summary>
        /// <param name="capturePaymentRequest">Capture payment request</param>
        /// <returns>Capture payment result</returns>
        public virtual CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest)
        {
            var paymentMethod = LoadPaymentMethodBySystemName(capturePaymentRequest.Order.PaymentMethodSystemName);
            if (paymentMethod == null)
                throw new SmartException(T("Payment.CouldNotLoadMethod"));

            try
            {
                return paymentMethod.Value.Capture(capturePaymentRequest);
            }
            catch (NotSupportedException)
            {
                var result = new CapturePaymentResult();
                result.AddError(T("Common.Payment.NoCaptureSupport"));
                return result;
            }
            catch
            {
                throw;
            }
        }
 /// <summary>
 /// Captures payment
 /// </summary>
 /// <param name="capturePaymentRequest">Capture payment request</param>
 /// <returns>Capture payment result</returns>
 public override CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest)
 {
     var result = new CapturePaymentResult();
     result.AddError(_localizationService.GetResource("Common.Payment.NoCaptureSupport"));
     return result;
 }
 /// <summary>
 /// Captures payment
 /// </summary>
 /// <param name="capturePaymentRequest">Capture payment request</param>
 /// <returns>Capture payment result</returns>
 public override CapturePaymentResult Capture(CapturePaymentRequest capturePaymentRequest)
 {
     var result = new CapturePaymentResult();
     result.AddError("Capture method not supported");
     return result;
 }