#raimund_code

1 messages ยท Page 1 of 1 (latest)

mental scrollBOT
#

๐Ÿ‘‹ 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/1357084311005692056

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

chilly carbon
#

Hello there

#

Expanding destination is the right way. What do you mean by saying:

type is recorded as UNKNOWN

#

Where are you seeing that exactly?

brazen flicker
#

In our DB where that method's outcome is recorded. All the other type-specific fields are empty which is consistent with that outcome.

#

What I'm asking is whether the Java client reacts to the expansion by returning the destiunationObject as Card.

chilly carbon
#

It should, yes.

brazen flicker
#

Hm, so the above code should work?

chilly carbon
brazen flicker
#

Oh, hadn't seen that. Thanks. I'll still require some additional fields that are type-specific here though. Like last4 for cards. My idea was to grab that from the destinationObject as well.

chilly carbon
#

Are you using getDestinationObject() here?

brazen flicker
#

Yes

mental scrollBOT
brazen flicker
#

?

chilly carbon
#

Oh okay yeah that returns an ExternalAccount... hmm I'm not a Java dev so I wonder if you need to do some casting here.

#

Let me grab a colleague who knows more about Java

brazen flicker
#

The casting can't work if instanceof Card doesn't return true.

chilly carbon
#

No I mean you need to cast the whole object. Like can you cast payoutDestination into Card?

#

I'd assume that you are supposed to look at type here in the response and then cast accordingly? But I'm not sure on that.

brazen flicker
#

Only if instanceof Card will return true. Else I'll run into an Exception.

chilly carbon
#

Hmm okay yeah this is where we are at the extent of my (very minimal) Java knowledge.

#

Give me a moment to grab someone

brazen flicker
#

Thanks. ๐Ÿ™‚

fresh hawk
#

@brazen flicker Can you print payoutDestination.getClass() to see what it is?

brazen flicker
#

I'm preparing that at the moment. ๐Ÿ™‚

fresh hawk
#

Also in you code I see you do payoutDestination instanceof Card) for card but payoutDestination instanceof com.stripe.model.BankAccount for bank account

#

You sure you imported the right Card class?

#

Should be com.stripe.model.Card

brazen flicker
#

Yes, it's correct.

fresh hawk
#

Let us know what payoutDestination.getClass() shows

brazen flicker
#

Nvm, I think I 've got it now. It looks like the webhook we're receiving from you is faster than our own code. Sorry, I've been barking up the wrong tree.

fresh hawk
#

No worries. Glad you got it

brazen flicker
#

I'm guessing there's no way the Webhook object would contain this information, right?

fresh hawk
#

Correct

#

You can't get events with params expanded already

#

you'd have to explicitly retrieve the object via the api and pass expand