Beispiel #1
0
        /// <summary>
        /// Partial payment refund
        /// </summary>
        public Payment Refund(decimal amount)
        {
            var refund = new Refund
            {
                PaymentId = this.Id,
                Amount    = amount
            };

            refund.Save();

            if (refund.Id.HasValue)
            {
                var payment = Payment.FindById(Id);
                Status       = payment.Status;
                StatusDetail = payment.StatusDetail;
                TransactionAmountRefunded = payment.TransactionAmountRefunded;
                Refunds = payment.Refunds;
            }
            else
            {
                //Errors = refund.Errors;
            }

            return(this);
        }
        public MercadoPago.Resources.Payment Refund()
        {
            Refund refund = new Refund(sdk);

            refund.manualSetPaymentId((Decimal)this.Id.Value);
            refund.Save();
            if (refund.Id.HasValue)
            {
                this.Status = new PaymentStatus?(PaymentStatus.refunded);
            }
            return(this);
        }
Beispiel #3
0
        /// <summary>
        /// Payment refund
        /// </summary>
        public Payment Refund()
        {
            Refund refund = new Refund();

            refund.manualSetPaymentId((decimal)this.Id);
            refund.Save();

            if (refund.Id.HasValue)
            {
                this.Status = PaymentStatus.refunded;
            }
            else
            {
                //this.DelegateErrors(refund.Errors);
            }
            return(this);
        }
Beispiel #4
0
        /// <summary>
        /// Payment refund
        /// </summary>
        public Payment Refund()
        {
            var refund = new Refund
            {
                PaymentId = this.Id
            };

            refund.Save();

            if (refund.Id.HasValue)
            {
                this.Status = PaymentStatus.refunded;
            }
            else
            {
                //this.DelegateErrors(refund.Errors);
            }
            return(this);
        }
Beispiel #5
0
        /// <summary>
        /// Partial payment refund
        /// </summary>
        public Payment Refund(decimal?amount, MPRequestOptions requestOptions)
        {
            Refund refund = new Refund();

            refund.manualSetPaymentId((decimal)Id);
            refund.Amount = amount;
            refund.Save(requestOptions);

            if (refund.Id.HasValue)
            {
                var payment = Payment.FindById(Id, WITHOUT_CACHE, requestOptions);
                Status       = payment.Status;
                StatusDetail = payment.StatusDetail;
                TransactionAmountRefunded = payment.TransactionAmountRefunded;
                Refunds = payment.Refunds;
            }
            else
            {
                _errors = refund.Errors;
            }

            return(this);
        }
Beispiel #6
0
        /// <summary>
        /// Partial payment refund
        /// </summary>
        public Payment Refund(decimal?amount, MPRequestOptions requestOptions)
        {
            Refund refund = new Refund();

            refund.manualSetPaymentId((decimal)_id);
            refund.Amount = amount;
            refund.Save(requestOptions);

            if (refund.Id.HasValue)
            {
                Thread.Sleep(500);
                var payment = Payment.FindById(_id, WITHOUT_CACHE, requestOptions);
                _status        = payment.Status;
                _status_detail = payment.StatusDetail;
                _transaction_amount_refunded = payment.TransactionAmountRefunded;
                _refunds = payment.Refunds;
            }
            else
            {
                _errors = refund.Errors;
            }

            return(this);
        }