stripe / stripe-java

Java library for the Stripe API.

Home Page:https://stripe.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PaymentIntent error when gson version is < 2.9.1

Siddikpatel opened this issue · comments

Describe the bug

When I tried to create a PaymentIntent with gson version 2.8.9 or 2.9.0, it gave me this exception classNotFoundException: com.google.gson.ReflectionAccessFilter. It only works when I set gson version to 2.9.1.

To Reproduce

  1. Set the gson version to any version less than 2.9.1
  2. Try creating a paymentIntent using Spring boot. (set spring.mvc.converters.preferred-json-mapper=gson in application.properties file before running the program)
  3. An error will occur.

Expected behavior

Gson should be able to parse the JSON values of a stripe object when gson 2.8.9 or 2.9.0 is used.

Code snippets

java.lang.ClassNotFoundException: com.google.gson.ReflectionAccessFilter

<dependency>
	<groupId>com.google.code.gson</groupId>
	<artifactId>gson</artifactId>
	<version>2.9.0</version>
</dependency>

OS

Windows 11

Java version

Java 17

stripe-java version

v24.0.0

API version

2023-10-16

Additional context

No response

Well, the gson 2.9.0 and 2.8.9 were released in 2022 and 2021 so they might didn't have this class.

Just confirming that we document in our readme that you need gson 2.10.1 with stripe-java