<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic getting connect time out to apitest.authorize.net:443? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-connect-time-out-to-apitest-authorize-net-443/m-p/85570#M53829</link>
    <description>&lt;P&gt;hello community&lt;/P&gt;&lt;P&gt;we have a grails app. you can consider it a java app. we have integrated authorize.net for accepting payments via credit card. I have used accept.js library.&lt;/P&gt;&lt;P&gt;the part of code that sends request to authorize.net to charge credit card is as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def descriptor = params['dataDescriptor']&lt;BR /&gt;def value = params['dataValue']&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;String firstName = params[AuthNetField.X_FIRST_NAME.fieldName]&lt;BR /&gt;String lastName = params[AuthNetField.X_LAST_NAME.fieldName]&lt;BR /&gt;String address = params[AuthNetField.X_ADDRESS.fieldName]&lt;BR /&gt;String city = params[AuthNetField.X_CITY.fieldName]&lt;BR /&gt;String state = params[AuthNetField.X_STATE.fieldName]&lt;BR /&gt;String zip = params[AuthNetField.X_ZIP.fieldName]&lt;BR /&gt;String country = params[AuthNetField.X_COUNTRY.fieldName]&lt;BR /&gt;String phone = params[AuthNetField.X_PHONE.fieldName]&lt;BR /&gt;String email = params[AuthNetField.X_EMAIL.fieldName]&lt;/P&gt;&lt;P&gt;String apiLoginId = grailsApplication.config.net.authorize.apiLoginId&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if (grailsApplication.config.net.authorize.environment == net.authorize.Environment.PRODUCTION){&lt;BR /&gt;ApiOperationBase.setEnvironment(Environment.PRODUCTION);&lt;BR /&gt;}&lt;BR /&gt;else{&lt;BR /&gt;ApiOperationBase.setEnvironment(Environment.SANDBOX);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;String transactionKey = grailsApplication.config.net.authorize.transactionKey&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;&lt;BR /&gt;merchantAuthenticationType.setName(apiLoginId);&lt;BR /&gt;merchantAuthenticationType.setTransactionKey(transactionKey);&lt;BR /&gt;ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);&lt;/P&gt;&lt;P&gt;// Populate the payment data&lt;BR /&gt;PaymentType paymentType = new PaymentType();&lt;BR /&gt;OpaqueDataType OpaqueData = new OpaqueDataType();&lt;BR /&gt;OpaqueData.setDataDescriptor(descriptor);&lt;BR /&gt;OpaqueData.setDataValue(value);&lt;BR /&gt;paymentType.setOpaqueData(OpaqueData);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CustomerDataType cdt = new CustomerDataType()&lt;BR /&gt;cdt.setEmail(email)&lt;/P&gt;&lt;P&gt;CustomerAddressType customerType = new CustomerAddressType()&lt;BR /&gt;customerType.setFirstName(firstName)&lt;BR /&gt;customerType.setLastName(lastName)&lt;BR /&gt;customerType.setAddress(address)&lt;BR /&gt;customerType.setCity(city)&lt;BR /&gt;customerType.setState(state)&lt;BR /&gt;customerType.setZip(zip)&lt;BR /&gt;customerType.setCountry(country)&lt;BR /&gt;customerType.setPhoneNumber(phone)&lt;/P&gt;&lt;P&gt;// Create the payment transaction request&lt;BR /&gt;TransactionRequestType txnRequest = new TransactionRequestType();&lt;BR /&gt;txnRequest.setTransactionType(TransactionTypeEnum.AUTH_CAPTURE_TRANSACTION.value());&lt;BR /&gt;txnRequest.setPayment(paymentType);&lt;BR /&gt;txnRequest.setBillTo(customerType)&lt;BR /&gt;txnRequest.setCustomer(cdt)&lt;/P&gt;&lt;P&gt;ArrayOfLineItem aol = new ArrayOfLineItem()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;itemizedOrderEntries.each { io -&amp;gt;&lt;/P&gt;&lt;P&gt;def parts = io.split("&amp;lt;\\|&amp;gt;")&lt;/P&gt;&lt;P&gt;LineItemType lit = new LineItemType()&lt;BR /&gt;lit.setItemId(parts[0])&lt;BR /&gt;lit.setName(parts[1])&lt;BR /&gt;lit.setDescription(parts[2])&lt;BR /&gt;lit.setQuantity(parts[3].toBigDecimal())&lt;BR /&gt;lit.setUnitPrice(parts[4].toBigDecimal())&lt;BR /&gt;lit.setTaxable(parts[5].toBoolean())&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;aol.lineItem.add(lit)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;txnRequest.setLineItems(aol)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;txnRequest.setAmount(total.setScale(2, RoundingMode.CEILING));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Make the API Request&lt;BR /&gt;CreateTransactionRequest apiRequest = new CreateTransactionRequest();&lt;BR /&gt;apiRequest.setTransactionRequest(txnRequest);&lt;BR /&gt;CreateTransactionController controller = new CreateTransactionController(apiRequest);&lt;BR /&gt;controller.execute();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CreateTransactionResponse tresponse = controller.getApiResponse();&lt;/P&gt;&lt;P&gt;When the execute() method is called the app sends request to test api but i am getting connect time out&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have pasted the error below.&lt;/P&gt;&lt;P&gt;2023-01-28 23:53:17.082 ERROR --- [pool-4-thread-1] net.authorize.util.HttpCallTask : Http request execute failed: 'Connect to apitest.authorize.net:443 [apitest.authorize.net/198.241.206.22] failed: connect timed out'&lt;BR /&gt;2023-01-28 23:53:17.082 WARN --- [pool-4-thread-1] net.authorize.util.HttpCallTask : Adding ErrorMessage: Code: 'org.apache.http.conn.ConnectTimeoutException', Text: 'Connect to apitest.authorize.net:443 [apitest.authorize.net/198.241.206.22] failed: connect timed out'&lt;BR /&gt;2023-01-28 23:53:17.083 ERROR --- [nio-8443-exec-3] n.a.a.controller.base.ApiOperationBase : Invalid response:'net.authorize.api.contract.v1.ANetApiResponse@6744ad91'&lt;BR /&gt;2023-01-28 23:53:17.091 ERROR --- [nio-8443-exec-3] StackTrace : Full Stack Trace:&lt;/P&gt;&lt;P&gt;When i run the app locally in my system it can successfully connect to the api link but when i run it remotely i.e our web app is hosted at Hetzner server, it gives connect time out error.&lt;/P&gt;&lt;P&gt;do you know what is causing this connect timeout?&lt;/P&gt;&lt;P&gt;i appreciate any guide.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sun, 29 Jan 2023 07:45:50 GMT</pubDate>
    <dc:creator>sanjaygir</dc:creator>
    <dc:date>2023-01-29T07:45:50Z</dc:date>
    <item>
      <title>getting connect time out to apitest.authorize.net:443?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-connect-time-out-to-apitest-authorize-net-443/m-p/85570#M53829</link>
      <description>&lt;P&gt;hello community&lt;/P&gt;&lt;P&gt;we have a grails app. you can consider it a java app. we have integrated authorize.net for accepting payments via credit card. I have used accept.js library.&lt;/P&gt;&lt;P&gt;the part of code that sends request to authorize.net to charge credit card is as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def descriptor = params['dataDescriptor']&lt;BR /&gt;def value = params['dataValue']&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;String firstName = params[AuthNetField.X_FIRST_NAME.fieldName]&lt;BR /&gt;String lastName = params[AuthNetField.X_LAST_NAME.fieldName]&lt;BR /&gt;String address = params[AuthNetField.X_ADDRESS.fieldName]&lt;BR /&gt;String city = params[AuthNetField.X_CITY.fieldName]&lt;BR /&gt;String state = params[AuthNetField.X_STATE.fieldName]&lt;BR /&gt;String zip = params[AuthNetField.X_ZIP.fieldName]&lt;BR /&gt;String country = params[AuthNetField.X_COUNTRY.fieldName]&lt;BR /&gt;String phone = params[AuthNetField.X_PHONE.fieldName]&lt;BR /&gt;String email = params[AuthNetField.X_EMAIL.fieldName]&lt;/P&gt;&lt;P&gt;String apiLoginId = grailsApplication.config.net.authorize.apiLoginId&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if (grailsApplication.config.net.authorize.environment == net.authorize.Environment.PRODUCTION){&lt;BR /&gt;ApiOperationBase.setEnvironment(Environment.PRODUCTION);&lt;BR /&gt;}&lt;BR /&gt;else{&lt;BR /&gt;ApiOperationBase.setEnvironment(Environment.SANDBOX);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;String transactionKey = grailsApplication.config.net.authorize.transactionKey&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;&lt;BR /&gt;merchantAuthenticationType.setName(apiLoginId);&lt;BR /&gt;merchantAuthenticationType.setTransactionKey(transactionKey);&lt;BR /&gt;ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);&lt;/P&gt;&lt;P&gt;// Populate the payment data&lt;BR /&gt;PaymentType paymentType = new PaymentType();&lt;BR /&gt;OpaqueDataType OpaqueData = new OpaqueDataType();&lt;BR /&gt;OpaqueData.setDataDescriptor(descriptor);&lt;BR /&gt;OpaqueData.setDataValue(value);&lt;BR /&gt;paymentType.setOpaqueData(OpaqueData);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CustomerDataType cdt = new CustomerDataType()&lt;BR /&gt;cdt.setEmail(email)&lt;/P&gt;&lt;P&gt;CustomerAddressType customerType = new CustomerAddressType()&lt;BR /&gt;customerType.setFirstName(firstName)&lt;BR /&gt;customerType.setLastName(lastName)&lt;BR /&gt;customerType.setAddress(address)&lt;BR /&gt;customerType.setCity(city)&lt;BR /&gt;customerType.setState(state)&lt;BR /&gt;customerType.setZip(zip)&lt;BR /&gt;customerType.setCountry(country)&lt;BR /&gt;customerType.setPhoneNumber(phone)&lt;/P&gt;&lt;P&gt;// Create the payment transaction request&lt;BR /&gt;TransactionRequestType txnRequest = new TransactionRequestType();&lt;BR /&gt;txnRequest.setTransactionType(TransactionTypeEnum.AUTH_CAPTURE_TRANSACTION.value());&lt;BR /&gt;txnRequest.setPayment(paymentType);&lt;BR /&gt;txnRequest.setBillTo(customerType)&lt;BR /&gt;txnRequest.setCustomer(cdt)&lt;/P&gt;&lt;P&gt;ArrayOfLineItem aol = new ArrayOfLineItem()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;itemizedOrderEntries.each { io -&amp;gt;&lt;/P&gt;&lt;P&gt;def parts = io.split("&amp;lt;\\|&amp;gt;")&lt;/P&gt;&lt;P&gt;LineItemType lit = new LineItemType()&lt;BR /&gt;lit.setItemId(parts[0])&lt;BR /&gt;lit.setName(parts[1])&lt;BR /&gt;lit.setDescription(parts[2])&lt;BR /&gt;lit.setQuantity(parts[3].toBigDecimal())&lt;BR /&gt;lit.setUnitPrice(parts[4].toBigDecimal())&lt;BR /&gt;lit.setTaxable(parts[5].toBoolean())&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;aol.lineItem.add(lit)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;txnRequest.setLineItems(aol)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;txnRequest.setAmount(total.setScale(2, RoundingMode.CEILING));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Make the API Request&lt;BR /&gt;CreateTransactionRequest apiRequest = new CreateTransactionRequest();&lt;BR /&gt;apiRequest.setTransactionRequest(txnRequest);&lt;BR /&gt;CreateTransactionController controller = new CreateTransactionController(apiRequest);&lt;BR /&gt;controller.execute();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CreateTransactionResponse tresponse = controller.getApiResponse();&lt;/P&gt;&lt;P&gt;When the execute() method is called the app sends request to test api but i am getting connect time out&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have pasted the error below.&lt;/P&gt;&lt;P&gt;2023-01-28 23:53:17.082 ERROR --- [pool-4-thread-1] net.authorize.util.HttpCallTask : Http request execute failed: 'Connect to apitest.authorize.net:443 [apitest.authorize.net/198.241.206.22] failed: connect timed out'&lt;BR /&gt;2023-01-28 23:53:17.082 WARN --- [pool-4-thread-1] net.authorize.util.HttpCallTask : Adding ErrorMessage: Code: 'org.apache.http.conn.ConnectTimeoutException', Text: 'Connect to apitest.authorize.net:443 [apitest.authorize.net/198.241.206.22] failed: connect timed out'&lt;BR /&gt;2023-01-28 23:53:17.083 ERROR --- [nio-8443-exec-3] n.a.a.controller.base.ApiOperationBase : Invalid response:'net.authorize.api.contract.v1.ANetApiResponse@6744ad91'&lt;BR /&gt;2023-01-28 23:53:17.091 ERROR --- [nio-8443-exec-3] StackTrace : Full Stack Trace:&lt;/P&gt;&lt;P&gt;When i run the app locally in my system it can successfully connect to the api link but when i run it remotely i.e our web app is hosted at Hetzner server, it gives connect time out error.&lt;/P&gt;&lt;P&gt;do you know what is causing this connect timeout?&lt;/P&gt;&lt;P&gt;i appreciate any guide.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 07:45:50 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-connect-time-out-to-apitest-authorize-net-443/m-p/85570#M53829</guid>
      <dc:creator>sanjaygir</dc:creator>
      <dc:date>2023-01-29T07:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: getting connect time out to apitest.authorize.net:443?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-connect-time-out-to-apitest-authorize-net-443/m-p/85576#M53833</link>
      <description>&lt;P&gt;i have posted the issue in detail here&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/75273375/getting-connect-timeout-when-sending-request-to-authorize-net-from-deployed-app" target="_blank"&gt;https://stackoverflow.com/questions/75273375/getting-connect-timeout-when-sending-request-to-authorize-net-from-deployed-app&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 05:57:53 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-connect-time-out-to-apitest-authorize-net-443/m-p/85576#M53833</guid>
      <dc:creator>sanjaygir</dc:creator>
      <dc:date>2023-01-30T05:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: getting connect time out to apitest.authorize.net:443?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-connect-time-out-to-apitest-authorize-net-443/m-p/85597#M53847</link>
      <description>&lt;P&gt;i got it to work after switching to another server location. it seems like authorize.net blocked ips at oregon location.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 07:05:58 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/getting-connect-time-out-to-apitest-authorize-net-443/m-p/85597#M53847</guid>
      <dc:creator>sanjaygir</dc:creator>
      <dc:date>2023-02-01T07:05:58Z</dc:date>
    </item>
  </channel>
</rss>

