-2

I am trying to get sagepay to work agin but get this error Type

'Gap66.Web.PaymentGateway.SagepayForm.PaymentRequest' already defines a member called 'this' with the same parameter types

    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";
pnuts
  • 58,317
  • 11
  • 87
  • 139
Dominic
  • 1
  • 1

1 Answers1

1

Exactly what the error says.

You define this[string] here:

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

Then you define it again here:

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

You can only define members of the same signature once. Otherwise the code would have no way of knowing which one you're trying to invoke when you invoke it.

David
  • 208,112
  • 36
  • 198
  • 279
  • I got this code from my website that is working at the moment , but I haven't got the source code , as my website developer suddenly shut down and said he lost it all so i used .net decompiler it, so not sure way this has done this, and how to fix it ,all I am trying to do is change sage pay from 2.23 to 3.00 if there is any extra help you or someone else can help with it would be getting me out of a big problem – Dominic Jul 05 '15 at 11:37