#alvy_api
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/1305843039704711200
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
The connected account is acct_1OjOMLAzEwPFa7UJ
hi! well if you're using Direct Charges make sure you use https://docs.stripe.com/connect/authentication#stripe-account-header
the customer ID is cus_R1tmK7vaumZXkZ
the payment method ID is pm_1Q9q0WAzEwPFa7UJO9Lp1hvy
we use the Stripe-Account header already
our Stripe payment integration has been operational for five years
we've never experienced this problem with debit/credit card payments
but now we've started using BACS Direct Debit payment methods (mandates), we are randomly getting these errors:
so what's the error exactly? what API request did you make, what error did it return, what's the request ID req_xxx from the request
No such PaymentMethod: 'pm_1Q9q0WAzEwPFa7UJO9Lp1hvy'
and what API request are you making when you get that error?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
I can't find this request in the dashboard
the request was made today (2024-11-12) @ 06:00:29 UTC
then it's probably on the connected account
you can click any of those and get the request ID
ok, then can you get the ID from your logs?
those subscription requests are being made by another company working on the account
all we have are these:
we store the Stripe API response error, that's it
you'll likely want to increase your observability then so you catch error and log the request ID https://docs.stripe.com/api/errors/handling which is returned in the HTTP headers of the error
without that it's hard for us to say much, that error can means lots of things(wrong API key, using Stripe-Account header, not using Stripe-Account header, object has been deleted)
ok
I'll see if I can get these in to our logs
and come back when we retry
can I continue the conversation in this thread or will I need to start a new one?
depends how quickly you come back! if it's still open you can post here
okee
yes
we've rolled out some debugging to store the request ID onto our production environment
and attempted to re-run against the same payment method again
no changes to our payment intent code, no payment method or customer changes
and this time... it has worked
req_zMU7tjpNQBxnLQ
how is this possible?
how could a payment attempt at 6am fail with "No such payment method", but at 11:50am it works fine?
can't say because I don't know why it failed the first time and don't have an example of the failure
we've seen this happen before - a payment failing early in the morning, but working fine later in the day
maybe you changed the API key/config in your production environment when you re-deployed .
we have changed nothing
as far as you know, always possible something changed!
anyway, if you see a problem again, share the request ID and we'll tell you why it failed
and wait for it to happen at 6am another time
yeah will do
thank you for your help
๐
looking at the logs in the account you have other errors from the 9th November like No such PaymentMethod: 'sub_1QHMzeAzEwPFa7UJ3nNaVIbQ' (when creating "invoice 16334") that seem to indicate a bug(since your code should never be passing a Subscription ID sub_xxx to the payment_method parameter) Hopefully with the extra observability/logging it will be possible to track down issues easier!
yeah thats the other company working with this client
they're numpties
we've already told them to resolve that
this No such payment method: pm_xxxxx error has been observed with some of our customers, and it always happens to BACS Direct Debit payments rather than debit/credit card payment methods
we've raised this issue before but inevitably met with the same response: we need a req ID!
at least we have it in place now
so lets see what happens next time
is it possible to see a Payment method's "creation" date at all in the dashboard?
I'm curious if the mandate is added and payment attempted because the mandate is active
I'm a bit confused since it seems like it's all the same Connect platform (B******B***h) in the all the requests you're talking about
they pushed this payment method ID into us (Billingbooth)
an inactive mandate wouldn't cause a "no such pm_xxx" error I don't think(but maybe there's an edge case and it does, again, that's why we need examples)
but instead of pushing the pm_xxxx
they pushed a subscription ID
they push stuff into us via our APi, then in turn we try and take payment with Stripe
maybe sometimes they push a pm_xxx that is wrong and not created on the account they say it is? : )
and then you try and make a request on a different account and thus , error
this particular example I'm giving you: the customer directly used our platform to browse their Stripe payment methods, selected the payment method, then chose to take the payment next day (today)
so it feels like the payment method was there already and relatively well established
(as in, it's been "added" a fair few days ago)
just trying to work out the pattern
yeah but maybe it's on a different account thant you think, maybe it's deleted/detached, maybe it was in test mode but you're in livemode etc. Anyway all that can be answered with one example so I'll stop there