输入' Gap66.Web.PaymentGateway.SagepayForm.PaymentRequest'已经定义了一个名为' this'具有相同的参数类型

时间:2015-06-28 12:53:34

标签: c# sagepay

我试图让sagepay工作agin但是得到这个错误类型

  

' Gap66.Web.PaymentGateway.SagepayForm.PaymentRequest'已定义   一个名为“这个'使用相同的参数类型

    string Gap66.Web.PaymentGateway.IPaymentRequest.CustomerEmail
    {
        get
        {
            return this._customerEmail;
        }
        set
        {
            this._customerEmail = this.SetProperty<string>("CustomerEmail", value);
        }
    }

   string this[string lineBreaks]
    {
        get
        {
            if (this.ReadyToSend)
            {
                return string.Empty;
            }
            StringBuilder builder = new StringBuilder();
            foreach (KeyValuePair<string, object> pair in this.RequiredFields)
            {
                if (pair.Value == null)
                {
                    builder.AppendFormat("The field {0} is required, but has no value.{1}", pair.Key, lineBreaks);
                }
            }
            return builder.ToString();
        }
    }

    Uri Gap66.Web.PaymentGateway.IPaymentRequest.PostUrl
    {
        get
        {
            switch (this.SubmissionMode)
            {
                case Gap66.Web.PaymentGateway.SubmissionMode.Simulator:
                    return new Uri("https://test.sagepay.com/Simulator/VSPFormGateway.asp");

                case Gap66.Web.PaymentGateway.SubmissionMode.Test:
                    return new Uri("https://test.sagepay.com/gateway/service/vspform-register.vsp");

                case Gap66.Web.PaymentGateway.SubmissionMode.Live:
                    return new Uri("https://live.sagepay.com/gateway/service/vspform-register.vsp");
            }
            return null;
        }
    }

   string Gap66.Web.PaymentGateway.IPaymentRequest.Provider
    {
        get
        {
            return "SagePay Form";
        }
    }

    bool Gap66.Web.PaymentGateway.IPaymentRequest.ReadyToInitialise
    {
        get
        {
            return this.CheckRequiredInfoSet();
        }
    }

    bool Gap66.Web.PaymentGateway.IPaymentRequest.ReadyToSend
    {
        get
        {
            return (this.CheckRequiredInfoSet() && !string.IsNullOrEmpty(this.Crypt));
        }
    }

    Dictionary<string, object> Gap66.Web.PaymentGateway.IPaymentRequest.RequiredFields
    {
        get
        {
            return PaymentUtility.GetRequiredFields(this);
        }
    }

    Gap66.Web.PaymentGateway.SubmissionMode Gap66.Web.PaymentGateway.IPaymentRequest.SubmissionMode
    {
        get
        {
            return this._submissionMode;
        }
        set
        {
            this._submissionMode = value;
        }
    }

    TransactionType Gap66.Web.PaymentGateway.IPaymentRequest.TxType
    {
        get
        {
            return this._txType;
        }
        set
        {
            this._txType = value;
        }
    }

    string Gap66.Web.PaymentGateway.IPaymentRequest.VendorId
    {
        get
        {
            return this._vendor;
        }
        set
        {
            this._vendor = value;
        }
    }

    string Gap66.Web.PaymentGateway.IPaymentRequest.VendorTxId
    {
        get
        {
            return this._vendorTxCode;
        }
        set
        {
            this._vendorTxCode = this.SetProperty<string>("VendorTxCode", value);
        }
    }

    /// <summary>
    /// Gets the not ready reason.
    /// </summary>
    /// <value>The not ready reason.</value>
    string this[string lineBreaks]
    {
        get
        {
            if (this.ReadyToSend)
            {
                return string.Empty;
            }
            StringBuilder builder = new StringBuilder();
            foreach (KeyValuePair<string, object> pair in this.RequiredFields)
            {
                if (pair.Value == null)
                {
                    builder.AppendFormat("The field {0} is required, but has no value.{1}", pair.Key, lineBreaks);
                }
            }
            return builder.ToString();
        }
    }

    /// <summary>
    /// Gets the post URL.
    /// </summary>
    /// <value>The post URL.</value>
    public Uri PostUrl
    {
        get
        {
            switch (this.SubmissionMode)
            {
                case Gap66.Web.PaymentGateway.SubmissionMode.Simulator:
                    return new Uri("https://test.sagepay.com/Simulator/VSPFormGateway.asp");

                case Gap66.Web.PaymentGateway.SubmissionMode.Test:
                    return new Uri("https://test.sagepay.com/gateway/service/vspform-register.vsp");

                case Gap66.Web.PaymentGateway.SubmissionMode.Live:
                    return new Uri("https://live.sagepay.com/gateway/service/vspform-register.vsp");
            }
            return null;
        }
    }

    public string Provider
    {
        get
        {
            return "SagePay Form";

1 个答案:

答案 0 :(得分:1)

错误的确切含义。

您可以在此处定义this[string]

string this[string lineBreaks]
{
    get
    {
        //...
    }
}

然后在此处再次定义

string this[string lineBreaks]
{
    get
    {
        //...
    }
}

您只能定义一次相同签名的成员。否则,在您调用它时,代码无法知道您尝试调用哪一个。