Version Error
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.
31 Replies
⌛
This post has been reserved for your question.
Hey @Maxxx005! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
show the code for validation
@KineticMate Pasting unsolicited LLM responses isn't helpful. If someone wants an LLM response, they can ask the LLM.
See #❗︱how-to-get-help
Controller and service
i am using cashfree api for the payment gateway
I think it should be
x-api-version
and not just version
Cashfree Payments Developer Documentation
Cashfree Payments Developer Documentation
Welcome to the Cashfree Payments developer documentation. You will find help about Cashfree Payments products and APIs that will help you start using our products quickly.
The current version is
2023-08-01
and 2025-01-01
is an "upcoming version" or betaI think you can also just use
v4
for the version there
pingwhat changes do i need to make in my code?
change the
headers.set("version", version);
to headers.set("x-api-version", version);
and you might also want to use 2023-08-01
💤
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.
Using API Version: null
[2m2025-01-08T12:06:55.065+05:30[0;39m [31mERROR[0;39m [35m14620[0;39m [2m---[0;39m [2m[Connect] [nio-8082-exec-5][0;39m [2m[0;39m[36mo.a.c.c.C.[.[.[/].[dispatcherServlet] [0;39m [2m:[0;39m 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
Can you show the full stack trace?
What's line 56 of CashFreeService?
Also are you using Spring 5?
I am using spring 3.2.5
ah right it's
Objects.requireNonNull
.body.put("customer_details", Map.of(
"customer_id", customerId,
"customer_email", customerEmail,
"customer_phone", customerPhone
line 56,57,58,59
so one of
customerId
, customerEmail
or customerPhone
is null
ok let me check
yes you are correct i am not storing phone number so it shoould be null.
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
elementokay so now i have included number as well so could you tell me that will it require +91 etc. kind of formatted number?
?
like some of the api only accept formatted numbers like in the prefix of the number you must include the country code .
just send it as a string formatted correctly
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!!!!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
no problem
💤
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.
💤
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.