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;
            }
        }
Exemple #2
0
        public static SendAuthorizeRequestData initSendAuthorizeRequestData()
        {
            SendAuthorizeRequestData sar = new SendAuthorizeRequestData();

            sar.setEncodingMethod(ENCODINGMETHOD);
            sar.setMerchant(MERCHANT);
            sar.setSecurity(SECURITY);
            sar.setUrl_error("http://someurl.com/error/");
            sar.setUrl_ok("http://someurl.com/ok/");
            sar.setMonto(100);
            sar.setNrooperacion("20160920_04");

            MedioDePago medioDePago = new TarjetaCredito("1", "6", true);

            sar.setMedioPago(medioDePago);

            return sar;
        }
Exemple #3
0
 public SendAuthorizeRequestResponse sendAuthorizeRequest(SendAuthorizeRequestData sar)
 {
     return auth.sendAuthorizeRequest(sar);
 }