示例#1
0
        /// <summary>
        /// Creates a clone of this CaptureTransactionRequest object
        /// </summary>
        /// <returns>A clone of this CaptureTransactionRequest object</returns>
        public CaptureTransactionRequest Clone()
        {
            Payment payment = PaymentDataSource.Load(this.Payment.PaymentId);
            CaptureTransactionRequest clone = new CaptureTransactionRequest(payment, this.RemoteIP);

            clone.Amount       = this.Amount;
            clone.CurrencyCode = this.CurrencyCode;
            clone.IsFinal      = this.IsFinal;
            foreach (string key in this.ExtendedProperties.Keys)
            {
                clone.ExtendedProperties[key] = this.ExtendedProperties[key];
            }
            return(clone);
        }
示例#2
0
        /// <summary>
        /// Captures this payment
        /// </summary>
        /// <param name="amount">The amount to capture</param>
        /// <param name="final">If <b>true</b> this capture is considered to be the final capture</param>
        /// <param name="async">If <b>true</b> payment is captured asynchronously</param>
        /// <param name="remoteIP">Remote IP of the user initiating the request</param>
        public virtual void Capture(LSDecimal amount, bool final, bool async, string remoteIP)
        {
            CaptureTransactionRequest request = new CaptureTransactionRequest(this, remoteIP);

            request.Amount  = amount;
            request.IsFinal = final;
            if (!async)
            {
                PaymentEngine.DoCapture(request);
            }
            else
            {
                PaymentEngine.AsyncDoCapture(request);
            }
        }