#jaybabu_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1225129026553909269
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! I'm honestly not sure, I'm not very good with Java. Let me ask someone else internally, hang on...
Thank you
for my knowledge, the final basically makes it so a class can't be extended or changed in any way. is there a reason why the classes have that? removing that would make this much simpler
Someone who's way better at Java than I am will be here in a few minutes and should be able to help you. ๐
๐ Hello! Hopping in here
Hey Karbi
I'm not familiar with why those classes are marked final but I know it's been like this since we introduced the new client/service pattern in v23 (https://github.com/stripe/stripe-java/wiki/Migration-guide-for-v23).
I fyou don't want to go down the wrapper route you could see if the older pre-v23 pattern has an easier way for you to add in logging, but I'm not super familiar with Spring AOP so it's not a guarantee
would there be friction in removing the final? none of the other stripe sdks, i've seen have this restriction
i would prefer not moving all the existing code to use the older version
spring aop is very similar to aspectj if you are familiar with that
I'm not dead set on the aop approach. I just need a way to log the input and output of each method in the service without having to rewrite every method in every service class
if hooks or interceptors exists, that is fine toou
Digging around, it looks like one of the recommendations is to wrap LiveStripeResponseGetter (https://github.com/stripe/stripe-java/blob/master/src/main/java/com/stripe/net/LiveStripeResponseGetter.java)
do you have an example?
i think you mean to say extend the request method?
Yeah you'd override the extend method, and you could use the LiveStripeResponseGetter object in ApiResource.setStripeResponseGetter(myStripeResponseGetter)
You can see an example at https://github.com/stripe/stripe-java/issues/1556#issuecomment-1532304946