#Chen - NPE

1 messages ยท Page 1 of 1 (latest)

static anvil
#

Can you share your code? Need more info to help debug

unborn sundial
#

The code is something like this:

    cardId,
    CardRetrieveParams.builder().apply {
        addExpand("number")
        addExpand("cvc")
     }.build(),
    RequestOptionsBuilder().build()
)
static anvil
#

Is the above stacktrace the complete stacktrace? If there's more, can you share the whole thing even if it's messy

unborn sundial
#

The additional stack trace basically points to the code sample above.

#

That's all the trace related to Stripe SDK.

hoary ravine
#

๐Ÿ‘‹ Hello - hopping in to help

unborn sundial
#

karbi!! Good to see you here!

hoary ravine
#

Can you try something out really quick for me? What happens if you retrieve the physical card, but remove the addExpand lines?

unborn sundial
#

Good idea. Trying.

#

Sorry it's taking some time. Still on it.

hoary ravine
#

no rush!

unborn sundial
#

public static Card retrieve(String card, RequestOptions options) throws StripeException { interface throws NPE for both the physical card and the virtual card.

#

Same result if I call public static Card retrieve(String card, Map<String, Object> params, RequestOptions options) throws StripeException { but with an empty map as params.

hoary ravine
#

Hmm... didn't you say it worked with the virtual card before? Is it suddenly not working?

unborn sundial
#

The only working scenario is calling public static Card retrieve(String card, Map<String, Object> params, RequestOptions options) throws StripeException but with the two expand params

#

for virtual cards

hoary ravine
#

hmm... let me try some things out on my end. I have some guesses, but need to try it for myself

#

What does your import for Card look like?

unborn sundial
#

com.stripe.model.issuing.Card

hoary ravine
#

and what happens when you try this:
Card card = (Card) Card.retrieve(cardId);

unborn sundial
#

Oh interesting. Let me see

#

We are on Kotlin so actually I'm not sure what's the right syntax for that.

#

I tried Card.retrieve(...) as Card but I guess that's not the same.

hoary ravine
#

Oh dang it - I'm not familiar with Kotlin so I don't know what the exact syntax is ๐Ÿ˜ฆ

unborn sundial
#

But the stack trace shows com.stripe.model.issuing.Card.retrieve(Card.java:292) is called, so it should be calling the right interface, right?

hoary ravine
#

Yeah that's true - let me check around to see if any of my teammates are more familiar with kotlin and can help

unborn sundial
#

Thank you

cosmic mauve
#

Hi @unborn sundial ๐Ÿ‘‹ I'm jumping in to help out. I must be honest, I've only ever come across Kotlin in the context of Android programming.

unborn sundial
#

Hi hi! Welcome to the party ๐Ÿ˜„

cosmic mauve
#

Can you clarify what platform you're developing on?

unborn sundial
#

microservice

cosmic mauve
unborn sundial
#

Checking

#

Hi sorry, looks like I was using the wrong config file. After an update the request went through.

#

Sorry about the confusion.

cosmic mauve
#

๐ŸŽ‰ great to hear it!

#

Sometimes it just takes talking the issue through and taking a second look.

unborn sundial
#

yea it's super helpful to check the request id. That's when I realized the requests were actually not being sent out ๐Ÿ˜