0

I want to configure 2Checkout sandbox API with Java.enter image description here

I created test account and API keys. But I can't manage to match them in this java code:

public void testProductsList() throws Exception
    {

        Twocheckout.apiusername = "901328163";
        Twocheckout.apipassword = "B1536FC3-18AB-4289-BD25-2C84906345A8";
        Twocheckout.privatekey = "81DBF3E3-04B3-47DB-8068-ED7DAB20BC5A";
        Twocheckout.mode = "sandbox";

        HashMap<String, String> params = new HashMap<String, String>();

        ProductList result = TwocheckoutProduct.list(params);
        Product[] products = result.getProducts();
        System.out.println(Arrays.toString(products));
    }

I always get com.twocheckout.TwocheckoutException: Authentication failed

Can you give some advice?

Peter Penzov
  • 1,126
  • 134
  • 430
  • 808

0 Answers0