Decidir_SDK.RequestData.SendAuthorizeRequestData.getPayload C# (CSharp) Method

getPayload() public method

public getPayload ( ) : String
return String
        public String getPayload()
        {
            String payload = "<Request>";
            payload += "<NROCOMERCIO>" + this.getMerchant() + "</NROCOMERCIO>";
            payload += "<SECURITY>" + this.getSecurity() + "</SECURITY>";
            payload += "<SESSION>" + this.getSession() + "</SESSION>";
            payload += "<URL_OK>" + this.getUrl_ok() + "</URL_OK>";
            payload += "<URL_ERROR>" + this.getUrl_error() + "</URL_ERROR>";
            payload += "<ENCODINGMETHOD>" + this.getEncodingMethod() + "</ENCODINGMETHOD>";
            payload += "<MONTO>" + this.getMonto().Replace(",", ".") + "</MONTO>";
            payload += "<NROOPERACION>" + this.getNrooperacion() + "</NROOPERACION>";

            if (this.getCyberSourceData() != null)
            {
                payload += this.getCyberSourceData().getForPayload();
            }

            if (this.getCyberSourceVertical() != null)
            {
                payload += this.getCyberSourceVertical().getForPayload();
            }

            if (this.getMedioDePago() != null)
            {
                payload += this.getMedioDePago().getForPayload();
            }
            if (this.getComerciosAgregadores() != null)
            {
                payload += this.getComerciosAgregadores().getForPayload();
            }
            if (this.getSplitData() != null)
            {
                payload += this.getSplitData().getForPayload();
            }

            payload += "</Request>";
            return payload;
        }

Usage Example

Example #1
0
        public SendAuthorizeRequestResponse sendAuthorizeRequest(SendAuthorizeRequestData sar)
        {
            try
            {
                using (client = new AuthorizeService.AuthorizePortTypeClient(this.AuthorizeBinding, this.AuthorizeEndpoint))
                {
                    HeaderHttpExtension.AddCustomHeaderUserInformation(new OperationContextScope(client.InnerChannel), this.Headers);

                    string statusMessage, URL_Request, RequestKey, PublicRequestKey;

                    var statusCode = client.SendAuthorizeRequest(sar.getSecurity(),
                                                                 sar.getSession(),
                                                                 sar.getMerchant(),
                                                                 sar.getUrl_ok(),
                                                                 sar.getUrl_error(),
                                                                 sar.getEncodingMethod(),
                                                                 sar.getPayload(),
                                                                 out statusMessage,
                                                                 out URL_Request,
                                                                 out RequestKey,
                                                                 out PublicRequestKey);

                    SendAuthorizeRequestResponse response = new SendAuthorizeRequestResponse(statusCode, statusMessage, URL_Request, RequestKey, PublicRequestKey);
                    return response;
                }
            }
            catch (Exception ex)
            {
                SendAuthorizeRequestResponse response = new SendAuthorizeRequestResponse(0, ex.Message, "", "", "");
                return response;
            }
        }