<?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: HTTP response code: 403 for URL: https://testsecureacceptance.cybersource.com/pay in cybersource APIs</title>
    <link>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88617#M1362</link>
    <description>&lt;P&gt;Hey juanguzman,&lt;/P&gt;&lt;P&gt;I suspect you're getting a 403 because you're missing some of the required headers or they're improperly formatted. I'm not familiar with the parameter map pattern you're implementing here, but it might be worth trying to use the &lt;A href="https://github.com/CyberSource/cybersource-rest-client-java" target="_self"&gt;Java rest client&lt;/A&gt; to do some of the lifting on your behalf.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CyberSource/cybersource-unified-checkout-sample-java" target="_self"&gt;This example&lt;/A&gt; uses Unified Checkout not Secure Acceptance, but a lot of the same principles are going to apply, you'll just need to generate your &lt;FONT face="andale mono,times"&gt;Call&lt;/FONT&gt; using the&amp;nbsp;&lt;FONT face="andale mono,times"&gt;callAuthenticationHeader&amp;nbsp;&lt;/FONT&gt;method.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/CyberSource/cybersource-unified-checkout-sample-java/blob/7b1e731ee4f7aab178bf86e0c1843d059b466495/src/main/java/com/cybersource/example/service/CaptureContextService.java#L39" target="_self"&gt;Create an &lt;FONT face="andale mono,times"&gt;ApiClient&lt;/FONT&gt; using a &lt;/A&gt;&lt;FONT face="andale mono,times"&gt;&lt;A href="https://github.com/CyberSource/cybersource-unified-checkout-sample-java/blob/7b1e731ee4f7aab178bf86e0c1843d059b466495/src/main/java/com/cybersource/example/service/CaptureContextService.java#L39" target="_self"&gt;MerchantConfig class&lt;/A&gt;. &lt;/FONT&gt;This is all done in one line in the example. The required properties are listed here, with sample values here. It sounds like you might be using OAuth or another authentication type, but you switch that property to the desired value that'll work, otherwise this code should work with the HTTP signature authentication type if you're open to that.&lt;/LI&gt;&lt;LI&gt;Create a call using the &lt;FONT face="andale mono,times"&gt;buildCall&lt;/FONT&gt; method. I don't have an example of this on GitHub to hand, but it should be relatively straightforward, something along the lines of:&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="java"&gt;// Above here would be code which sets up the required merchant config properties in a standard Java Properties class
final ApiClient apiClient = new ApiClient(new MerchantConfig(applicationProperties.getAsJavaProperties()));
apiclient.buildCall(saPath, "POST", jsonFormattedRequestBody, null, null, null, null)&lt;/LI-CODE&gt;&lt;P&gt;I believe you won't need to pass the header params as there's an internal call to&amp;nbsp;&lt;FONT face="andale mono,times"&gt;callAuthenticationHeader&lt;/FONT&gt;, but I'm not 100% sure there.&lt;/P&gt;&lt;P&gt;If you want to keep generating the request without the SDK, it might be worth comparing your headers to the ones &lt;A href="https://github.com/CyberSource/cybersource-unified-checkout-sample-java/blob/7b1e731ee4f7aab178bf86e0c1843d059b466495/src/main/java/com/cybersource/example/service/CaptureContextService.java#L56" target="_self"&gt;here&lt;/A&gt;. I know there were some recent minor changes to the signature though and I have not tested this code against them, so it might be best to leverage the SDK to avoid any issues there.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jan 2024 20:32:08 GMT</pubDate>
    <dc:creator>skirch</dc:creator>
    <dc:date>2024-01-12T20:32:08Z</dc:date>
    <item>
      <title>HTTP response code: 403 for URL: https://testsecureacceptance.cybersource.com/pay</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88553#M1351</link>
      <description>&lt;P&gt;I wanted to call &lt;A href="https://testsecureacceptance.cybersource.com/pay" target="_blank"&gt;https://testsecureacceptance.cybersource.com/pay&lt;/A&gt; using HttpURLConnection. This is a similar pattern used in the sample JSP of the documentation. 403 error is thrown, and looking at the Secure Acceptance instance, no transaction is logged. Has anyone encountered this issue before? I saw this post&amp;nbsp;&lt;A href="https://support.cybersource.com/knowledgebase/Knowledgearticle/?code=000002283" target="_blank"&gt;https://support.cybersource.com/knowledgebase/Knowledgearticle/?code=000002283&lt;/A&gt;&amp;nbsp;all keys are working fine using JSP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;url = new URL("https://testsecureacceptance.cybersource.com/pay");

            final HttpURLConnection connection = (HttpURLConnection) url.openConnection();

            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", APPLICATION_JSON);
            connection.setRequestProperty("Accept", APPLICATION_JSON);
            connection.setDoOutput(true);

            // Create a map to hold parameters
            final Map&amp;lt;String, String&amp;gt; parameters = new HashMap&amp;lt;&amp;gt;();
            parameters.put("access_key", accesskey);
            parameters.put("profile_id", profileId);
            parameters.put("transaction_uuid", transactionId);
            parameters.put("signed_field_names", signedFieldNames);
            parameters.put("unsigned_field_names", unsignedFieldNames);
            parameters.put("signed_date_time", signedDateTime);
            parameters.put("locale", locale);
            parameters.put("transaction_type", transType);
            parameters.put("reference_number", "1356");
            parameters.put("amount", "123.00");
            parameters.put("currency", "USD");
            parameters.put("signature", signature);

            // Build the parameter string
            final String paramString = buildParameters(parameters);

            System.out.println("paramString: " + paramString);

            // Write the parameters to the output stream
            writeParameters(connection, paramString);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 12:23:04 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88553#M1351</guid>
      <dc:creator>juanguzman</dc:creator>
      <dc:date>2024-01-08T12:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP response code: 403 for URL: https://testsecureacceptance.cybersource.com/pay</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88617#M1362</link>
      <description>&lt;P&gt;Hey juanguzman,&lt;/P&gt;&lt;P&gt;I suspect you're getting a 403 because you're missing some of the required headers or they're improperly formatted. I'm not familiar with the parameter map pattern you're implementing here, but it might be worth trying to use the &lt;A href="https://github.com/CyberSource/cybersource-rest-client-java" target="_self"&gt;Java rest client&lt;/A&gt; to do some of the lifting on your behalf.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CyberSource/cybersource-unified-checkout-sample-java" target="_self"&gt;This example&lt;/A&gt; uses Unified Checkout not Secure Acceptance, but a lot of the same principles are going to apply, you'll just need to generate your &lt;FONT face="andale mono,times"&gt;Call&lt;/FONT&gt; using the&amp;nbsp;&lt;FONT face="andale mono,times"&gt;callAuthenticationHeader&amp;nbsp;&lt;/FONT&gt;method.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/CyberSource/cybersource-unified-checkout-sample-java/blob/7b1e731ee4f7aab178bf86e0c1843d059b466495/src/main/java/com/cybersource/example/service/CaptureContextService.java#L39" target="_self"&gt;Create an &lt;FONT face="andale mono,times"&gt;ApiClient&lt;/FONT&gt; using a &lt;/A&gt;&lt;FONT face="andale mono,times"&gt;&lt;A href="https://github.com/CyberSource/cybersource-unified-checkout-sample-java/blob/7b1e731ee4f7aab178bf86e0c1843d059b466495/src/main/java/com/cybersource/example/service/CaptureContextService.java#L39" target="_self"&gt;MerchantConfig class&lt;/A&gt;. &lt;/FONT&gt;This is all done in one line in the example. The required properties are listed here, with sample values here. It sounds like you might be using OAuth or another authentication type, but you switch that property to the desired value that'll work, otherwise this code should work with the HTTP signature authentication type if you're open to that.&lt;/LI&gt;&lt;LI&gt;Create a call using the &lt;FONT face="andale mono,times"&gt;buildCall&lt;/FONT&gt; method. I don't have an example of this on GitHub to hand, but it should be relatively straightforward, something along the lines of:&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="java"&gt;// Above here would be code which sets up the required merchant config properties in a standard Java Properties class
final ApiClient apiClient = new ApiClient(new MerchantConfig(applicationProperties.getAsJavaProperties()));
apiclient.buildCall(saPath, "POST", jsonFormattedRequestBody, null, null, null, null)&lt;/LI-CODE&gt;&lt;P&gt;I believe you won't need to pass the header params as there's an internal call to&amp;nbsp;&lt;FONT face="andale mono,times"&gt;callAuthenticationHeader&lt;/FONT&gt;, but I'm not 100% sure there.&lt;/P&gt;&lt;P&gt;If you want to keep generating the request without the SDK, it might be worth comparing your headers to the ones &lt;A href="https://github.com/CyberSource/cybersource-unified-checkout-sample-java/blob/7b1e731ee4f7aab178bf86e0c1843d059b466495/src/main/java/com/cybersource/example/service/CaptureContextService.java#L56" target="_self"&gt;here&lt;/A&gt;. I know there were some recent minor changes to the signature though and I have not tested this code against them, so it might be best to leverage the SDK to avoid any issues there.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 20:32:08 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88617#M1362</guid>
      <dc:creator>skirch</dc:creator>
      <dc:date>2024-01-12T20:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP response code: 403 for URL: https://testsecureacceptance.cybersource.com/pay</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88642#M1368</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;It seems like you're having a problem making a connection to "test secure acceptance" using Http URL Connection in Java. The server is responding with a 403 error, indicating an authorization issue.&lt;/P&gt;&lt;P&gt;Here are some things to look into:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;URL Permissions:&lt;/STRONG&gt; Ensure that the URL is accessible and that your credentials have the necessary permissions.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Request Headers:&lt;/STRONG&gt; Double-check the headers you're setting in your request. Make sure they match the server's requirements.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Security Protocols:&lt;/STRONG&gt; Confirm that the server supports the security protocols you are using.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Parameters and Payload:&lt;/STRONG&gt; Verify that the parameters you are sending match the expected format and are correctly signed.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Documentation Review:&lt;/STRONG&gt; Check the official documentation for any updates or changes in the API usage.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Logging and Debugging:&lt;/STRONG&gt; Enable detailed logging or debugging in your application to capture more information about the request and response.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If the issue persists, consider reaching out to Cyber Source support or community forums for assistance.&lt;/P&gt;&lt;P&gt;I hope this helps!&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Jan 2024 14:05:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88642#M1368</guid>
      <dc:creator>michaeljordy313</dc:creator>
      <dc:date>2024-01-17T14:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP response code: 403 for URL: https://testsecureacceptance.cybersource.com/pay</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88758#M1390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Facing a 403 error while connecting to "test secure acceptance" via Http URL Connection in Java? Here's a quick guide:&lt;/P&gt;&lt;P&gt;URL Permissions:&lt;BR /&gt;Confirm URL accessibility and check your credentials' permissions.&lt;/P&gt;&lt;P&gt;Request Headers:&lt;BR /&gt;Ensure headers align with the server's requirements.&lt;/P&gt;&lt;P&gt;Security Protocols:&lt;BR /&gt;Verify server support for your security protocols.&lt;/P&gt;&lt;P&gt;Parameters and Payload:&lt;BR /&gt;Check parameters match the expected format and are correctly signed.&lt;/P&gt;&lt;P&gt;Documentation Review:&lt;BR /&gt;Refer to the API documentation for updates or changes.&lt;/P&gt;&lt;P&gt;Logging and Debugging:&lt;BR /&gt;Enable detailed logging for more request/response information.&lt;/P&gt;&lt;P&gt;For persistent issues, contact Cyber Source support or community forums.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 07:18:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/HTTP-response-code-403-for-URL-https-testsecureacceptance/m-p/88758#M1390</guid>
      <dc:creator>joshbuttler</dc:creator>
      <dc:date>2024-02-07T07:18:28Z</dc:date>
    </item>
  </channel>
</rss>

