#raimund_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/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.
- raimund_api, 18 hours ago, 19 messages
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?
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.
It should, yes.
Hm, so the above code should work?
Yeah I see what you are saying. I'm not sure if that's the case actually -- will double check. But really it would be easier just to grab the type directly (https://docs.stripe.com/api/payouts/object#payout_object-type) without trying to examine the destination object itself for that.
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.
Are you using getDestinationObject() here?
Yes
?
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
The casting can't work if instanceof Card doesn't return true.
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.
Only if instanceof Card will return true. Else I'll run into an Exception.
Hmm okay yeah this is where we are at the extent of my (very minimal) Java knowledge.
Give me a moment to grab someone
Thanks. ๐
@brazen flicker Can you print payoutDestination.getClass() to see what it is?
I'm preparing that at the moment. ๐
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
Yes, it's correct.
Let us know what payoutDestination.getClass() shows
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.
No worries. Glad you got it
I'm guessing there's no way the Webhook object would contain this information, right?