Typo in Error Handling sample snippit for Java?

20 views
Skip to first unread message

Jerry Malcolm

unread,
Jun 20, 2024, 7:36:38 PM6/20/24
to Stripe API Discussion
Bear with me here.  I'm just getting started with Stripe.  I have experience with coding quite a few other payment systems.  Just found out our current provider just went bankrupt, and we have 10 days to migrate to keep from shutting down some of our function.

I started doing some sample code using the api document guides (which I LOVE by the way).  In the java snippit for error handling that shows all of the catch blocks, line 14 has:

} catch (APIConnectionException e) {

I got an error that APIConnectionException does not exist.  Digging into the Stripe jarfile, I found:
\com\stripe\exception\ApiConnectionException.class

Capitalization of API is different.  Is this an api version difference?  Or is it a typo in the sample?

I'm going to likely need a bit of help and advice as I go through my crash course of migrating to Stripe.  I look forward to getting to know you folks.

Thanks.

Jerry

Remi J.

unread,
Jun 20, 2024, 7:39:51 PM6/20/24
to api-d...@lists.stripe.com
Hello Jerry,

I'm sorry to hear about the sudden urgency to migrate processors but I'm glad you're using Stripe and I hope the integration will go smoothly! The Java code you shared is correct but I assume the issue is that you didn't properly import the class to be able to use it. What I recommend is to use the following import for all exceptions that our SDK can raise

import com.stripe.exception.*;

I hope this solves the issue. If it doesn't, please follow up with our support team on https://support.stripe.com/contact or talk to Stripe developers on our Discord server at https://stripe.com/go/developer-chat for real time help as I don't think the mailing list will be the best way to discuss potential future questions!

All the best!
Remi

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages