#mebezac_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/1387888826759774440
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
For context we used to just do Cliniko::StripeClient.client.invoices.retrieve('in_1Ps96DF2v1Yns8JbfH96mesl', expand: ['charge'])
and then i.charge.payment_method_details.card.last4
Hello, looking in to this. I don't think there is a way to get to the card's last 4 with just one call that retrieves the invoice while using expansion. Checking in to whether there is another easier way to do this
Thanks
As best as I can tell this isn't possible through the invoice object, I think the best way to do this with one call would be to listen to payment_intent.succeeded events as well, expand the charge or payment method when that event is received, and store the data from there
ok, thanks
Also it is a bit awkward to work with because we store some specific to us bookkeeping metadata on charge objects since it makes it easy for our CFO/team to get the info they need by doing an export on the transactions page in the dashboard, since that actually spits out a CSV of the charges, not payment intents.
I guess with allowing multiple payments on invoices, we just need to re-orient the way we've done things since charges are now a few levels deeper instead of being a direct 1-to-1 relationship to invoices.
Thanks again for confirming ๐