Are you using the FX Rates sample code? Here's the information that we currently have for Java sample code for the Foreign Exchange Rates API. Please see the .zip file attachment.
You can run the test to verify your Visa Developer Portal app credentials allow connectivity to the FX API via running the following class using junit, after decompressing the zip and editing the file with your Visa Developer Portal app credentials.
Edits to lines 57 – 66 would be enough to properly query the foreign exchange rate api: // Configure HTTP basic authorization: basicAuth apiClient.setUsername("YOUR USERNAME"); apiClient.setPassword("YOUR PASSWORD"); apiClient.setKeystorePath("YOUR KEYSTORE PATH"); apiClient.setKeystorePassword("YOUR KEYSTORE PASSWORD"); apiClient.setPrivateKeyPassword("YOUR PRIVATEKEY PASSWORD");
// To set proxy uncomment the below lines // apiClient.setProxyHostName("email@example.com"); // apiClient.setProxyPortNumber(0000);
You only need to uncomment and edit the proxy lines if your current connection requires a proxy to send external queries.
Once your app credentials have been updated, you can use maven “build project” or “mvn clean install” to import the required maven dependencies into your development environment and run the FxApiTest.java file as a junit test. You will be able to see a proper query response, assuming your credentials allow for proper connectivity.
Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.