コード例 #1
0
        internal RefundPaymentResult ExecuteRefund(RefundPaymentRequest refundPaymentRequest)
        {
            RefundPaymentResult         result         = new RefundPaymentResult();
            Dictionary <string, Object> responseRefund = new Dictionary <string, Object>();
            Dictionary <string, Object> response       = new Dictionary <string, Object>();

            if (refundPaymentRequest.IsPartialRefund)
            {
                responseRefund = ReturnRequest(refundPaymentRequest);
            }
            else
            {
                responseRefund = VoidRequest(refundPaymentRequest);
            }

            if (responseRefund.ContainsKey("VoidResponse"))
            {
                response = (Dictionary <string, Object>)responseRefund["VoidResponse"];
            }

            if (responseRefund.ContainsKey("ReturnResponse"))
            {
                response = (Dictionary <string, Object>)responseRefund["ReturnResponse"];
            }

            if (response.ContainsKey(TODOPAGO_STATUS_CODE))
            {
                System.Int64 statusCode = (System.Int64)response[TODOPAGO_STATUS_CODE];

                if (!statusCode.Equals(2011))
                {
                    // REFUND CON ERRORES
                    String statusMessage = (String)response[TODOPAGO_STATUS_MESSAGE];
                    result.AddError(statusCode + " - " + statusMessage);
                }
                else
                {
                    // REFUND BIEN
                    if (refundPaymentRequest.IsPartialRefund && refundPaymentRequest.Order.RefundedAmount + refundPaymentRequest.AmountToRefund < refundPaymentRequest.Order.OrderTotal)
                    {
                        result.NewPaymentStatus = PaymentStatus.PartiallyRefunded;
                    }
                    else
                    {
                        result.NewPaymentStatus = PaymentStatus.Refunded;
                    }
                }
            }

            return(result);
        }
コード例 #2
0
        static StackObject *Equals_3(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int64 obj = *(long *)&ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int64 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.Equals(obj);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
コード例 #3
0
        static StackObject *Equals_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Object obj = (System.Object) typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int64 instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.Equals(obj);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
コード例 #4
0
 protected object CheckParamValue(Int64 paramValue)
 {
     if (paramValue.Equals(CallingList.Common.ClsConstants.NullInt64))
     {
         return DBNull.Value;
     }
     else
     {
         return paramValue;
     }
 }
コード例 #5
0
 protected object CheckParamValue(Int64 paramValue)
 {
     if (paramValue.Equals(Constants.NullInt64))
     {
         return DBNull.Value;
     }
     else
     {
         return paramValue;
     }
 }