I'm trying to create a payment record, but it keeps giving me unauthorized, altho the token I'm providing is already valid. here's a sample call in java
MediaType mediaType = MediaType.parse("application/json"); String tenderId = "..."; RequestBody body = RequestBody.create(mediaType, "{ \"tender\":{ \"id\":\"" + tenderId + "\"},\"amount\":" + order.getTotal() + "}"); okhttp3.Request request = new okhttp3.Request.Builder() .url("https://sandbox.dev.clover.com/v3/merchants/" + authResult.merchantId + "/orders/" + orderId + "/payments?access_token=" + authResult.authToken) .post(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer " + authResult.authToken) .build(); client.newCall(request).enqueue...
so if someone can point out what is lacking or if the header format is wrong?
do note that I've already authorized on the dashboard the correct permissions. order and payment r/w for testing.
Cheers