#Version Error

41 messages · Page 1 of 1 (latest)

prime breach
#

org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: "{"message":"version value should be 2021-05-21 or 2022-01-01 or 2022-09-01 or 2023-08-01 or 2025-01-01 tried all this dates still getting version error.

pine furnaceBOT
#

This post has been reserved for your question.

Hey @prime breach! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

proper lichen
#

show the code for validation

olive quest
#

@mellow swan Pasting unsolicited LLM responses isn't helpful. If someone wants an LLM response, they can ask the LLM.

#

See #❗︱how-to-get-help

prime breach
#

i am using cashfree api for the payment gateway

olive quest
#

I think it should be x-api-version and not just version

#

The current version is 2023-08-01 and 2025-01-01 is an "upcoming version" or beta

#

I think you can also just use v4 for the version there

olive quest
prime breach
#

what changes do i need to make in my code?

olive quest
# prime breach what changes do i need to make in my code?
    private HttpHeaders createHeaders() {
        String version = "2025-01-01";
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_JSON);
        headers.set("x-client-id", appId);
        headers.set("x-client-secret", secretKey);
        headers.set("version", version); // Dynamically use the version from properties
        System.out.println("Using API Version: " + headers.get("version"));  // Log version
        return headers;
    }

change the headers.set("version", version); to headers.set("x-api-version", version);

#

and you might also want to use 2023-08-01

pine furnaceBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

prime breach
# olive quest ```java private HttpHeaders createHeaders() { String version = "2025...

Using API Version: null
2025-01-08T12:06:55.065+05:30 ERROR 14620 --- [Connect] [nio-8082-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet]  : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.RuntimeException: Error while creating subscription: Exception while creating order: null] with root cause

java.lang.NullPointerException: null after your suggested changes i am getting this exception

olive quest
#

Can you show the full stack trace?

pine furnaceBOT
prime breach
olive quest
#

What's line 56 of CashFreeService?

#

Also are you using Spring 5?

prime breach
#

I am using spring 3.2.5

olive quest
#

ah right it's Objects.requireNonNull

olive quest
prime breach
#

body.put("customer_details", Map.of(
"customer_id", customerId,
"customer_email", customerEmail,
"customer_phone", customerPhone
line 56,57,58,59

olive quest
#

so one of customerId, customerEmail or customerPhone is null

prime breach
#

ok let me check

#

yes you are correct i am not storing phone number so it shoould be null.

olive quest
#

Map.of doesn't work with null arguments

#

you could just create a HashMap and put the individual elements in it

#

possibly ignoring the null element

prime breach
#

okay so now i have included number as well so could you tell me that will it require +91 etc. kind of formatted number?

olive quest
#

?

prime breach
#

like some of the api only accept formatted numbers like in the prefix of the number you must include the country code .

olive quest
#

just send it as a string formatted correctly

prime breach
#

Finally my payment gateway has started working Thank you so much sir for your help. It really means a lot to me!! Your Answers were really accurate and helped me a lot solve my problems. This community is the best java community. It has all the help that a learning developer requires. Thank you so much once again!!!!

pine furnaceBOT
olive quest
#

no problem

pine furnaceBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.