#mathieu-canva - Java SDK Issues

1 messages ยท Page 1 of 1 (latest)

topaz mountain
#

Hello! Are you using the latest version of the SDK? Can you share specific errors/code?

brisk vigil
#

We are seeing some type as null

#

We are using v20.63.1

topaz mountain
#

Can you give me the ID of a Payment Method where you're seeing type set to null?

brisk vigil
#

Let me try to get that for you

#

cus_LNMIMJQGHOhddE

#

We have tried 3 times to create a setup intent on that customer

topaz mountain
#

That's a Customer object, not a Payment Method ID.

brisk vigil
#

the dashboard shows type = card but the SDK return null value

#

Yes but I am guessing you are able to look at the setup intent attempts for that customer? thanks

topaz mountain
brisk vigil
#

Yes

topaz mountain
#

That response shows the type is not null. Can you share the code that's showing the type as null?

brisk vigil
#

Yes showing it to you now via DM if that's ok?

topaz mountain
#

I have DMs disabled. Are you comfortable sharing the code here in public?

brisk vigil
#
java.lang.NullPointerException: null
    at com.xxx.stripe.Mapper.mapPaymentMethodType(Mapper.java:431)
    at com.xxx.stripe.Mapper.mapPaymentMethod(Mapper.java:352)
    at com.xxx.stripe.ApiStripeClient.createPaymentMethod(ApiStripeClient.jav
#

The PaymentMethod object in the function param is the Stripe SDK object

#

callinggetType() returns null for the above request

topaz mountain
#

Thanks, let me investigate, hang on...

brisk vigil
#

Thanks Rubeus ๐Ÿ™

#

Worth mentioning that this does not happen on every requests.e

topaz mountain
#

If you log paymentMethod when this happens what do you see there?

brisk vigil
#

We don't have logs atm for these

topaz mountain
#

Is this something you can reproduce on demand?

brisk vigil
#

No it's only happening sporadically in production

#

204 times in the last 30 days

topaz mountain
#

Can you show me the code where paymentMethod is created?

brisk vigil
#

Sure

topaz mountain
#

To clarify, I meant the code where the paymentMethod variable is populated, not where the Payment Method itself is actually created. Realized that wasn't clear, sorry. ๐Ÿ™‚

brisk vigil
#

We use LiveStripeResponseGetter

#

from the library

topaz mountain
#

Can I see the code?

brisk vigil
#

If you can't see how this could happen, then we can try to add logs

topaz mountain
#

My Java is really rusty, but it looks like you're forcing the response from the API into the PaymentMethod class regardless of it it fails or succeeds, correct? There are several failed Payment method creation requests on your account, like this one for example: https://dashboard.stripe.com/logs/req_CBaO90iHT7pK2t

#

If that code received one of these failed responses could that explain what you're seeing?

brisk vigil
#

The impl of stripe library handles that in
LiveStripeResponseGetter in handleApiError

#

We are catching the exceptions correctly for those