<?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 Re: When Charging Credit Card Get PKIX error path Exception in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/When-Charging-Credit-Card-Get-PKIX-error-path-Exception/m-p/69468#M42479</link>
    <description>&lt;P&gt;Here is the stacktrace of the error I am getting for the above issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;SEVERE: Http request execute failed: 'sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target'&lt;BR /&gt;Oct 21, 2019 2:11:25 PM net.authorize.util.HttpCallTask warn&lt;BR /&gt;WARNING: Adding ErrorMessage: Code: 'javax.net.ssl.SSLHandshakeException', Text: 'sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target'&lt;BR /&gt;Oct 21, 2019 2:11:25 PM net.authorize.api.controller.base.ApiOperationBase execute&lt;BR /&gt;SEVERE: Invalid response:'net.authorize.api.contract.v1.ANetApiResponse@6d66a588'&lt;BR /&gt;Failed to get response&lt;BR /&gt;sdfasdfa&lt;BR /&gt;Error: javax.net.ssl.SSLHandshakeException&lt;BR /&gt;sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2019 21:30:32 GMT</pubDate>
    <dc:creator>dhcho881</dc:creator>
    <dc:date>2019-10-21T21:30:32Z</dc:date>
    <item>
      <title>When Charging Credit Card Get PKIX error path Exception</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/When-Charging-Credit-Card-Get-PKIX-error-path-Exception/m-p/69467#M42478</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been using Authorize.net for a long time now, and with Java I have come to a problem with the SDK.&amp;nbsp; When I use the following below code I get an error.&amp;nbsp; Please help.&amp;nbsp; What must I do to resolve the issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The response object returned is returning always null.&amp;nbsp; Please tell me how I can help.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;response = controller.getApiResponse();&lt;BR /&gt;// Parse the response to determine results&lt;BR /&gt;if (response!=null) {&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;// Set the request to operate in either the sandbox or production environment&lt;BR /&gt;ApiOperationBase.setEnvironment(Environment.SANDBOX);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;// Create object with merchant authentication details&lt;BR /&gt;MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType();&lt;BR /&gt;merchantAuthenticationType.setName("6r46jMVd4X");&lt;BR /&gt;merchantAuthenticationType.setTransactionKey("932pRSL6Wq86ZxjM");&lt;BR /&gt;&lt;BR /&gt;// Populate the payment data&lt;BR /&gt;PaymentType paymentType = new PaymentType();&lt;BR /&gt;CreditCardType creditCard = new CreditCardType();&lt;BR /&gt;creditCard.setCardNumber(order.getCardnum());&lt;BR /&gt;creditCard.setExpirationDate(order.getExpire());&lt;BR /&gt;paymentType.setCreditCard(creditCard);&lt;/P&gt;&lt;P&gt;// Set email address (optional)&lt;BR /&gt;CustomerDataType customer = new CustomerDataType();&lt;BR /&gt;customer.setEmail(order.getCustomerEmail());&lt;/P&gt;&lt;P&gt;// Create the payment transaction object&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.setCustomer(customer);&lt;BR /&gt;txnRequest.setAmount(new BigDecimal(order.getAmount()).setScale(2, RoundingMode.CEILING));&lt;/P&gt;&lt;P&gt;// Create the API request and set the parameters for this specific request&lt;BR /&gt;CreateTransactionRequest apiRequest = new CreateTransactionRequest();&lt;BR /&gt;apiRequest.setMerchantAuthentication(merchantAuthenticationType);&lt;BR /&gt;apiRequest.setTransactionRequest(txnRequest);&lt;/P&gt;&lt;P&gt;// Call the controller&lt;BR /&gt;CreateTransactionController controller = new CreateTransactionController(apiRequest);&lt;BR /&gt;controller.execute();&lt;/P&gt;&lt;P&gt;// Get the response&lt;BR /&gt;CreateTransactionResponse response = new CreateTransactionResponse();&lt;BR /&gt;response = controller.getApiResponse();&lt;BR /&gt;// Parse the response to determine results&lt;BR /&gt;if (response!=null) {&lt;BR /&gt;// If API Response is OK, go ahead and check the transaction response&lt;BR /&gt;if (response.getMessages().getResultCode() == MessageTypeEnum.OK) {&lt;BR /&gt;TransactionResponse result = response.getTransactionResponse();&lt;/P&gt;&lt;P&gt;if (result.getMessages() != null) {&lt;BR /&gt;model.addAttribute("auth_response", "Credit card order processed successfully!");&lt;BR /&gt;System.out.println("Successfully created transaction with Transaction ID: " + result.getTransId());&lt;BR /&gt;System.out.println("Response Code: " + result.getResponseCode());&lt;BR /&gt;System.out.println("Message Code: " + result.getMessages().getMessage().get(0).getCode());&lt;BR /&gt;System.out.println("Description: " + result.getMessages().getMessage().get(0).getDescription());&lt;BR /&gt;System.out.println("Auth Code: " + result.getAuthCode());&lt;/P&gt;&lt;P&gt;String hostName = "localhost:3320";&lt;BR /&gt;String dbName = "mydb7";&lt;BR /&gt;String userName = "root";&lt;BR /&gt;String passWord = "";&lt;/P&gt;&lt;P&gt;Connection conn = null;&lt;BR /&gt;&lt;BR /&gt;PreparedStatement st1 = null;&lt;BR /&gt;&lt;BR /&gt;try {&lt;/P&gt;&lt;P&gt;try {&lt;BR /&gt;Class.forName("com.mysql.jdbc.Driver");&lt;BR /&gt;String url = "jdbc:mysql://" + hostName + "/" + dbName;&lt;BR /&gt;conn = DriverManager.getConnection(url, userName, passWord);&lt;BR /&gt;} catch(Exception e) {&lt;BR /&gt;e.printStackTrace();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;st1 = conn.prepareStatement(&lt;BR /&gt;"insert into orders (id, order_num, order_date, amount, customer_name, customer_email, customer_phone, "&lt;BR /&gt;+ "customer_address, cardnum, cardname, expire, code) values (?,?,now(),?,?,?,?,?,?,?,?,?)");&lt;/P&gt;&lt;P&gt;st1.setString(1, order.getId()+"");&lt;BR /&gt;st1.setString(2, order.getOrderNum()+"");&lt;BR /&gt;st1.setString(3, order.getAmount()+"");&lt;BR /&gt;st1.setString(4, order.getCustomerName()+"");&lt;BR /&gt;st1.setString(5, order.getCustomerEmail()+"");&lt;BR /&gt;st1.setString(6, order.getCustomerPhone()+"");&lt;BR /&gt;st1.setString(7, order.getCustomerAddress()+"");&lt;BR /&gt;st1.setString(8, order.getCardnum()+"");&lt;BR /&gt;st1.setString(9, order.getCardname()+"");&lt;BR /&gt;st1.setString(10, order.getExpire()+"");&lt;BR /&gt;st1.setString(11, order.getCode()+"");&lt;BR /&gt;&lt;BR /&gt;st1.execute();&lt;BR /&gt;st1.close();&lt;BR /&gt;conn.close();&lt;/P&gt;&lt;P&gt;} catch(SQLException sqle) {&lt;BR /&gt;sqle.printStackTrace();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;List&amp;lt;CartLineInfo&amp;gt; lines = cartInfo.getCartLines();&lt;BR /&gt;&lt;BR /&gt;for (CartLineInfo line1 : lines) {&lt;BR /&gt;OrderDetail detail = new OrderDetail();&lt;BR /&gt;detail.setId(UUID.randomUUID().toString());&lt;BR /&gt;detail.setOrder(order);&lt;BR /&gt;detail.setAmount(line1.getAmount());&lt;BR /&gt;detail.setPrice(line1.getProductInfo().getPrice());&lt;BR /&gt;detail.setQuanity(line1.getQuantity());&lt;BR /&gt;&lt;BR /&gt;String code = line1.getProductInfo().getCode();&lt;BR /&gt;Product product = productDAO.findProduct(code);&lt;BR /&gt;detail.setProduct(product);&lt;BR /&gt;&lt;BR /&gt;session.persist(detail);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// Set OrderNum for report.&lt;BR /&gt;// Set OrderNum d? thông báo cho ngu?i dùng.&lt;BR /&gt;cartInfo.setOrderNum(orderNum);&lt;BR /&gt;&lt;BR /&gt;} else {&lt;BR /&gt;model.addAttribute("auth_response", "Credit card order did not processed successfully!");&lt;BR /&gt;System.out.println("Failed Transaction.");&lt;BR /&gt;if (response.getTransactionResponse().getErrors() != null) {&lt;BR /&gt;System.out.println("Error Code: " + response.getTransactionResponse().getErrors().getError().get(0).getErrorCode());&lt;BR /&gt;System.out.println("Error message: " + response.getTransactionResponse().getErrors().getError().get(0).getErrorText());&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;} else {&lt;BR /&gt;System.out.println("Failed Transaction.");&lt;BR /&gt;model.addAttribute("auth_response", "Credit card order did not processed successfully!");&lt;BR /&gt;if (response.getTransactionResponse() != null &amp;amp;&amp;amp; response.getTransactionResponse().getErrors() != null) {&lt;BR /&gt;System.out.println("Error Code: " + response.getTransactionResponse().getErrors().getError().get(0).getErrorCode());&lt;BR /&gt;System.out.println("Error message: " + response.getTransactionResponse().getErrors().getError().get(0).getErrorText());&lt;BR /&gt;} else {&lt;BR /&gt;System.out.println("Error Code: " + response.getMessages().getMessage().get(0).getCode());&lt;BR /&gt;System.out.println("Error message: " + response.getMessages().getMessage().get(0).getText());&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;} else {&lt;BR /&gt;// Display the error code and message when response is null&lt;BR /&gt;ANetApiResponse errorResponse = controller.getErrorResponse();&lt;BR /&gt;model.addAttribute("auth_response", "Credit card order did not processed successfully!");&lt;BR /&gt;System.out.println("Failed to get response");&lt;BR /&gt;System.out.println("sdfasdfa");&lt;BR /&gt;if (!errorResponse.getMessages().getMessage().isEmpty()) {&lt;BR /&gt;System.out.println("Error: "+errorResponse.getMessages().getMessage().get(0).getCode()+" \n"+ errorResponse.getMessages().getMessage().get(0).getText());&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 21:27:46 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/When-Charging-Credit-Card-Get-PKIX-error-path-Exception/m-p/69467#M42478</guid>
      <dc:creator>dhcho881</dc:creator>
      <dc:date>2019-10-21T21:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: When Charging Credit Card Get PKIX error path Exception</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/When-Charging-Credit-Card-Get-PKIX-error-path-Exception/m-p/69468#M42479</link>
      <description>&lt;P&gt;Here is the stacktrace of the error I am getting for the above issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;SEVERE: Http request execute failed: 'sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target'&lt;BR /&gt;Oct 21, 2019 2:11:25 PM net.authorize.util.HttpCallTask warn&lt;BR /&gt;WARNING: Adding ErrorMessage: Code: 'javax.net.ssl.SSLHandshakeException', Text: 'sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target'&lt;BR /&gt;Oct 21, 2019 2:11:25 PM net.authorize.api.controller.base.ApiOperationBase execute&lt;BR /&gt;SEVERE: Invalid response:'net.authorize.api.contract.v1.ANetApiResponse@6d66a588'&lt;BR /&gt;Failed to get response&lt;BR /&gt;sdfasdfa&lt;BR /&gt;Error: javax.net.ssl.SSLHandshakeException&lt;BR /&gt;sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 21:30:32 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/When-Charging-Credit-Card-Get-PKIX-error-path-Exception/m-p/69468#M42479</guid>
      <dc:creator>dhcho881</dc:creator>
      <dc:date>2019-10-21T21:30:32Z</dc:date>
    </item>
  </channel>
</rss>

