#nickdnk_basil-changlog-lang-discrepancy

1 messages Ā· Page 1 of 1 (latest)

dense starBOT
#

šŸ‘‹ 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/1470474852828975166

šŸ“ 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.

fast anvil
#

Ack, thanks for flagging this.

#

Is the concern here specifically about the deprecated/removed fields discrepancy? I notice the list is longer for some SDKs than others; while the Ruby SDK apparently isn't impacted at all.

#

Which is ...weird, but I would expect that has more to do with the state of the SDKs prior to this change

tawdry quail
#

I'm not sure if the other SDKs just never had that field (but I would assume they all did?), I just know that I used $invoice->subscription in PHP, which I can't anymore

fast anvil
#

But I may be misunderstanding

tawdry quail
#

so it should be listed in the table as removed on that object

fast anvil
#

Gotcha okay okay

tawdry quail
#

it's a minor thing, but there are a lot of changes to go through and you could miss it

fast anvil
#

Yeah but worth flagging.

#

So many people YOLO their SDK/API upgrades, it will save us headache to make sure this is known upfront

tawdry quail
#

If you read all the text and review your code you'll still find it, but it should just be 1:1

fast anvil
#

What version did you upgrade from?

tawdry quail
#

SDK or API version?

fast anvil
#

SDK

tawdry quail
#

16

#

the previous major API version

#

the changelog is for Basil

#

I'm on Acacia

fast anvil
#

Thanks. I have flagged this discrepancy.

dense starBOT
#

nickdnk_basil-changlog-lang-discrepancy

tawdry quail
#

No problem. Edit: Err, I mean thanks. Or I guess both work.

fast anvil
#

Sure thing! Hopefully we'll get that sorted soon

tawdry quail
#

Not a rush for me of course. I'll report whatever else I find, so I may be back.

tawdry quail
#

I have another unrelated question. Do you want me to open another thread?

fast anvil
#

No here is fine

tawdry quail
#

Okay. So I'm trying to list all invoices and I want to get to the payment method used. Previously, I could do:

$params = [
    'customer' => 'customer_id_here',
    'limit'    => 15,
    'expand'   => ['data.payment_intent.source', 'data.charge']
];

$invoices = $stripe->invoices->all($params);

foreach ($invoices->data as $invoice) {

    if ($charge = $invoice->charge) {

        switch ($charge->payment_method_details?->type) {
          // do something
        }

     }
}

How do I get there with the payment listing logic? It seems to me I need to expand beyond the 4 limit (data.payments.data.payment.payment_intent.charge ??) Or do I have to loop and fetch each, cause that's going to be slow

fast anvil
#

Ah, this looks like it's the breaking of Invoice from the Payment Intent (and related Charge). It's much more work now šŸ¤¦ā€ā™‚ļø

tawdry quail
#

Yes, so what do I do

#

Docs say you don't surface payment.charge if there's a payment intent, which I guess is true for all payments these days

#

so I can't even shortcut to payments.charge cause allegedly it won't be there

fast anvil
#

Yup. You need to go through invoice.payments here

tawdry quail
#

This brings me to the expand limit

#

Assuming it's still 4?

fast anvil
#

And even that is painful because it's invoice.payments.payment.charge

#

I think so. We flagged, when basil was released, that this broke expansion patterns commonly used in List requests.

tawdry quail
#

which is 5

fast anvil
#

AH even more šŸ¤¦ā€ā™‚ļø

charge is only surfaced if the charge object is not associated with a payment intent. If the charge object does have a payment intent, the Invoice Payment surfaces the payment intent instead.

tawdry quail
#

So what am I supposed to do?

fast anvil
#

Retrieve the PI and expand the change and PM

tawdry quail
#

but that means a listing is multipled in requests by the list length

#

it's going to be painfully slow

fast anvil
#

Yeah, we flagged all of this.

tawdry quail
#

Big oof

fast anvil
#

Although it may be worth testing. Because I have seen expansion work to what appears to be 5 levels I think.

For a single invoice, the following works:

expand: {
    0: "lines.data.pricing.price_details.price",
  },
tawdry quail
#

data doesn't count

#

it's equal to lines.pricing.price_details.price

#

cause it's a list

#

so; invoice.payments.payment.payment_intent.charge is equal to invoice.payments.data.payment.payment_intent.charge

#

both are 5

fast anvil
#

Hmmm.... I just tested "lines.data.pricing.price_details.price.product" and that worked

tawdry quail
#

Yes, because that's 4

#

ah

#

sorry

#

Yea I dont know

fast anvil
#

But, I am on 2025-12-15.clover

tawdry quail
#

that shouldnt work unless you changed the expand limit

fast anvil
#

And using a beta version of the Python SDK (since I needed to test some preview features)

tawdry quail
#

Can you find out for me if this was officially changed? I have a lot of places where I am stopping at 4

#

SDK shouldn't matter, it's just a string passed to the API

#

like for the limit, I mean

#

Well actually I am listing invoices, not subscriptions, so I can probably get by with 4:
data.payments.data.payment.payment_intent.charge

fast anvil
#

Okay there are some places where it appears we support 5 layers but they do not appear to be clearly documented.

tawdry quail
#

Maybe it only applies to properties that can be expanded. I.e. payments.payment.payment_intent.charge is only 3 expands because payment is not being expanded

#

Not entirely clear if it's 4 nested layers or 4 expands

#

if that is the case, it's a lot less restrictive than I thought

fast anvil
#

Okay my colleague found the code where we exempt certain properties. Unfortunately Payment Intents and Charges are not in that list. I can file this as feedback though.

tawdry quail
#

It's probably one of the most commonly expanded objects, so I'm guessing there's a reason it's limited, or that it's not exempt

tawdry quail
#

either way I only seem to count 4 now, for what I need

fast anvil
tawdry quail
fast anvil
#

It mentions a change but doesn't call out that my 5 level expansion request gets exempted from the 4 level expansion limit. Unfortunately, this does not apply to the payments property and thus, you will still need 2 API requests to get the payment methods for each Invoice.

tawdry quail
#

Okay, but looking at it again I only count 4 expansions from invoice list to charge: data.payments.data.payment.payment_intent.charge

#

So I'll try that

fast anvil
#

Okay, sounds good