#alvy_api

1 messages ยท Page 1 of 1 (latest)

green ingotBOT
#

๐Ÿ‘‹ 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.

scarlet vector
#

The connected account is acct_1OjOMLAzEwPFa7UJ

stray parrot
scarlet vector
#

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:

stray parrot
#

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

scarlet vector
#

No such PaymentMethod: 'pm_1Q9q0WAzEwPFa7UJO9Lp1hvy'

stray parrot
scarlet vector
#

I can't find this request in the dashboard

#

the request was made today (2024-11-12) @ 06:00:29 UTC

stray parrot
#

then it's probably on the connected account

scarlet vector
#

it doesn't appear on the connected account logs

stray parrot
#

you can click any of those and get the request ID

scarlet vector
#

yes

#

but its none of those requests

stray parrot
#

ok, then can you get the ID from your logs?

scarlet vector
#

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

stray parrot
#

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)

scarlet vector
#

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?

stray parrot
#

depends how quickly you come back! if it's still open you can post here

scarlet vector
#

okee

scarlet vector
#

hello

#

are you still here

stray parrot
#

yes

scarlet vector
#

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

green ingotBOT
scarlet vector
#

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?

stray parrot
#

can't say because I don't know why it failed the first time and don't have an example of the failure

scarlet vector
#

we've seen this happen before - a payment failing early in the morning, but working fine later in the day

stray parrot
#

maybe you changed the API key/config in your production environment when you re-deployed .

scarlet vector
#

we have changed nothing

stray parrot
#

as far as you know, always possible something changed!

scarlet vector
#

ok well

#

I guess we'll keep the new debug code in place

stray parrot
#

anyway, if you see a problem again, share the request ID and we'll tell you why it failed

scarlet vector
#

and wait for it to happen at 6am another time

#

yeah will do

#

thank you for your help

#

๐Ÿ‘

stray parrot
#

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!

scarlet vector
#

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

stray parrot
scarlet vector
#

they pushed this payment method ID into us (Billingbooth)

stray parrot
#

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)

scarlet vector
#

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

stray parrot
#

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

scarlet vector
#

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

stray parrot
#

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

scarlet vector
#

yeah fair enough

#

I'll come back as and when I see it again, and we have more information via the req id

#

many thanks for the help