#_nerder
1 messages ยท Page 1 of 1 (latest)
Hello! There's a few diferent cases this could happen - one example if if you pass in customer to retrieve the upcoming invoice but the customer has not subscriptions or invoice items that need to be invoiced
ok, so for instance if the customer has no subscription and i'm trying to fetch the upcoming invoice it will be null?
let me try that out real quick
Yeah if they have no subscription and no invoice items then yes, you should get back a 404 error because there's no upcoming invoice
If i share with you some ids can you help me figure it out or is best to ask support?
I have this log, right before the crash:
Fetching upcoming invoice for subscription [sub_1N9NxDEs7Z8AGDaVnkfvkE0Z] when old item is [si_NvEQ36DSk5V9tR] and new price will be [price_1LXkGeEs7Z8AGDaVA58BASWS]
For the following account: acct_1LLp6TEs7Z8AGDaV
The code that is returning the empty invoice is the following (substituting the value from the log) :
const invoice = await this.stripe.invoices.retrieveUpcoming(
{
subscription: 'sub_1N9NxDEs7Z8AGDaVnkfvkE0Z',
subscription_items: [
{
id: 'si_NvEQ36DSk5V9tR',
price: 'price_1LXkGeEs7Z8AGDaVA58BASWS',
},
],
subscription_proration_behavior: 'always_invoice',
subscription_proration_date: Math.floor(Date.now() / 1000),
},
{ stripeAccount: gym.accountId.value },
);
in this scenario why is this giving back an empty invoice?
in this customer I can see an active subscription (actually 2)
Can you give me the full response you're getting back from the API when you're making that request?
umm this I don't really have, my code i breaking right after when i try to access invoice since is a null pointer
but I have the exact time in which this has happened
so maybe in some event log I can find it?
If you're logging it on your end you'll be able to find it, but we don't store the responses from GET requests on our end, which is why I asked if you had the full response
Is this something you've been able to reproduce at all? Like if you try this request right now, what do you get?
But in this case where should I find it? In the connected account logs or the platform?
No, i'm just seeing the error logs and trying to trace it back. Couldn't really try since this is for a production account. It will take me a while to setup
The request would be made on the connected account so I'd assume itd be in your connected account logs, but it entirely depends on how you're storing these logs on your end (and again, we don't keep track of the full response from these upcoming invoice requests on our end, so you wouldn't find it in the dashboard)
Do you maybe have the request ID? Or the exact timestamp?
I have the exact timestamp of the log, let me search for the request ID one-sec
๐ feel free to share both when you have them
I can't find it for some reason
the timestamp of the log is this one 2023-07-16 09:47:24.853 CEST
๐ let me see what I can find with just the timestamp
If i try to filter for v1/invoices/upcoming i don't see anything
Is this in the dashboard? Do you have GET requests enabled?
yes, and no
Based on the timestamp I'm guessing it's this request: req_NmxofIUWKQlDea
We have tools on our end to look at account requests
that's great
Based on what I'm seeing in the logs this should have returned a full Invoice - after you retrieve the upcoming invoice what is your code doing with invoice?
i'm just building an object like this:
return Invoice.of({
amountUnused: invoice.lines.data[0]?.amount,
amountRemaining: invoice.lines.data[1]?.amount,
currency: invoice.currency,
total: invoice.total,
id: invoice.from_invoice.invoice as string,
});
Are you 100% sure the invoice is null, or is it possible that just one of these specific atributes isn't being populated as you expect? The reason I ask is because the id: invoice.from_invoice.invoice as string, line if the above code is one that would probably fail/break for upcoming invoices because invoice.from_invoice is only populated for Invoice revisions
If you want the ID of the Invoice you can just do invoice.id
oh ok, i'm trying to find a better log to confirm this but the error i'm seeing in js is the following:
TypeError: Cannot read properties of null (reading 'invoice')
so it seems like it
Yeah since invoice.from_invoice is null, it can't read invoice from invoice.from_invoice
Oh i see!
Ok than
but seems like that upcoming invoice doesn't provide the id tho, look at this type spec:
type UpcomingInvoice = Omit<Stripe.Invoice, 'id'>;
Ahhh I forgot about that
I guess this is why I was using the from_invoice mistakenly
Is there a reason you need the upcoming invoice ID?
The Invoice isn't actually created at that point, which is why we don't actualyl return it
not really actually, is just because my domain object expect it
ok then, let me refactor my code to avoid this then
๐ yup that's what i'd suggest
thank you so much for this!
was indeed a very strange use-case that was driving me mad eheh
happy to help!
go ahead!
Why is not possible to enable iDeal for recurring payments for all the connected account but they need to do thay by themselves?
And, this will be actually possible to do if we move to Connect Express?
Let me start with your second question - what matters more here is what kind of funds flow you have. Typically with Express accounts you have destination charges, which look at the payment method settings on the Platform in order to determine which payment method types can be used
And so yes, if you're currently using direct charges, then moving to destination charges would allow you to use the settings on your platform
Now going back to your question about ideal/ that recurring settting
I'm not sure why we didn't also didn't ship the ability to manage this for connected accounts - it would have definitely been nice
I guess yes because we are using Stripe Connect (Standard)
Yes I agree, this for us means an extra "onboarding" step when we are helping our customers configure their Stripe Account for their first time
we have iDeal active in all our connected account by default, but we need to ask them to activate the recurring option if they want to use it for subscriptions (practially 100% of them wants it in The Netherland)
It will be cool yes ๐
I've open couple of those feedback, there is a way to "track" them on my side?
So that I remember to check them from time to time
If you need a way to track them you have to write in to support (https://support.stripe.com/contact) - that way they can keep a record of who requested what feature
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Ok, good to know i'll do that from next time
cool, thank you so much @strange pond super helpful as always
๐