#lynn-millard_error

1 messages ยท Page 1 of 1 (latest)

fallen thistleBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

torpid raven
#

hi there, can you provide an example request ID where you see this error? it should look like req_1234

torpid juniper
#

does this help

#

"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such PaymentMethod: 'pm_1SVDqL00hi7eYUa5F5XS7GQ9'",
"param": "payment_method",
"payment_intent": null,
"payment_method": null,
"payment_method_type": null,
"request_log_url": "https://dashboard.stripe.com/acct_1PVvJTFdSXDAGnNH/logs/req_6DKLnpJaAT6jQA?t=1763568186",

Learn more about Stripe API error codes and how to resolve them.

torpid raven
#

yes, I can use the request ID in there, one moment

torpid juniper
#

req_6DKLnpJaAT6jQA

torpid raven
#

it looks like the payment method in that request was created on account acct_1QiJqn00hi7eYUa5. since the request is being made on acct_1PVvJTFdSXDAGnNH, the payment method would have to exist on that account in order for the request to be successful

torpid juniper
#

can i tell which accounts codes were used to create the pm and the subsequent requests in dashboard log?

torpid raven
#

yes, in Workbench you can look at the Stripe-Account header to determine which account the request was executed on. if there's no Stripe-Account header, the request was made on your own platform

torpid juniper
#

i think i gave you the request for a different error than i originally stated

#

how do i see the account code for the created pm

fallen thistleBOT
oak magnet
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away.

There isn't a great way to tell from the Payment Method itself which account it belongs to. If you're able to see and retrieve it, then it belongs to your account, otherwise you sort of need to keep track of that.

Can you help me understand how you've structured your Connect integration?

#

I also see the request you shared was a livemode request. Did you get this flow working as expected in testmode or a sandbox first?

torpid juniper
#

no it was working with separate accounts then we setup connected accounts.

#

its works 95% of the time then about 5-10 times a day we get the payment method not found. almost seems like a timing issue. like the pm isnt available yet

#

another clue. before we setup connected accounts we would get the payment error and i would wait up to 10 seconds and retry with the idempotency key. and that would usually work. i tried that with the create customer for a connected account and it does not appear to help.

oak magnet
#

Do you have examples of where it worked? Because this flow should never work the way it's coded based on what I'm seeing.

Idempotency keys just cause the new request to return the same response as the previous request. They're meant for safely retrying requests that you don't know the result of due to network issues, not to retry a request from a business logic perspective.

torpid juniper
#

well that is what was recomended and in that it case seemed to work. just another data point ...

oak magnet
#

This isn't a timing issue, it's a coding issue. Do you have examples of where this worked as expected? What are you trying to do here, are you trying to clone payment methods to your Connected Accounts?

#

(at least I'm pretty sure it's not a timing issue)

torpid juniper
#

this is how we do it. we use the payment element in react to get the payment method. i pass the connected account code to the element.

#

we pass the pm to the backend and it uses the same account code to create a customer attached to the pm. then create a pement intent and charge the card.

#

var requestOptions = new RequestOptions();
var AccountCode = settings.GetSetting(StripeConstants.AccountCode);
if (!string.IsNullOrEmpty(AccountCode))
requestOptions.StripeAccount = AccountCode;

                var service = new PaymentMethodService();
                paymentMethod = await service.GetAsync(paymentMethodID, requestOptions: requestOptions);
#

before i create a customer i call that code and it gets the error

oak magnet
#

Ah, these are two different Connected Accounts you're using. You're creating the Paymetn Method on one account, then trying to use it on another Connected Account. That isn't supported.

#

Are you intending to do this?

torpid juniper
#

no i didnt say that. i am passing the same account code to the react component and in the back end

oak magnet
#

That's not what the requests are showing me

torpid juniper
#

all of them or just the error?

oak magnet
#

I'm not sure, you've only shared the errored one. But it wouldn't error if the same Account ID is used consistently.

torpid juniper
#

ok so what are you are suggesting is that i may have an occasional mismatch of the account codes?

#

if you want to see a successful charge what do you want to see?

#

what should i give you

oak magnet
#

You need to debug why your system craeted the PM on one Connected Account:
https://dashboard.stripe.com/acct_1QiJqn00hi7eYUa5/logs/req_SyR0LvS6Hat2YM
then tried to use it for a different Connected Account:
https://dashboard.stripe.com/acct_1PVvJTFdSXDAGnNH/logs/req_6DKLnpJaAT6jQA

Then make whatever coding changes are needed to prevent that from continuing to happen.

torpid juniper
#

can i tell which account the pm was created on in the logs?

oak magnet
#

I'm not as familiar with the dashboard side of Stripe (my teammates and I specialize in helping with our API in this forum), but I think the logs may be buried inside of the Connected Accounts in the dashboard, so it may tell you sort of indirectly.

torpid juniper
#

i can get the pm from the error then i need to track backwards to find where it was created

oak magnet
#

I shared a link to the request where it was created for your convenience in my earlier message. Not sure if the link will take you straight there since it was done in a Connected Account though, but the Account ID is in that second URL.

torpid juniper
#

sorry im trying to follow how you determined the requests were made on different accounts.

oak magnet
#

Well I had a head start because I knew what to look for based on the error. That error + Connect is almost always the wrong account context being used.

It might be hard if you don't have logging for this on your end.

torpid juniper
#

so my method is ok as long as the account codes are consistent across the requests. i hope so since i have numerous companies charging thru the system.

oak magnet
#

Yup, exactly.

torpid juniper
#

one more question. creating a customer is required in order to allow subsequent charges to a payment method?

oak magnet
#

Yes

torpid juniper
#

ok thank you i will attempt to verify the account codes

#

can this thread be reopened later?