#nrh-cklimas
1 messages · Page 1 of 1 (latest)
I'm also getting an API error message trying to change the payment method on the subscription, but I'm not sure if this is the same problem or something else I'm doing wrong. (Error says: "No such PaymentMethod: 'pm_XXXX'; OAuth key or Stripe-Account header was used but API request was provided with a platform-owned payment method ID. Please ensure that the provided payment method matches the specified account")
yes. I'm also very inexperienced with Stripe 🙂
here's the listing in the table (blacked out my email address). clicking on that shows the error message.
what is the Subscription ID and PaymentIntent ID
it says the paymentintent ID is pi_3Li1OlPbhdfvD1kV0IZ61tWa
I'm not sure how to find the subscription ID
ok so the Subscription and PaymentIntentu ID live on the connected account since your Platform created it on the connected accounts acct_1JhHQsPbhdfvD1kV
I assume you're searching for the PaymentIntent on the Platform account, but it doens't live there, you need to look in the acct_1JhHQsPbhdfvD1kV Dashboard
aha! this fixed it.
thank you!
as for my other issue, I think the problem is that the code is creating a payment method not linked to the relevant account.
does that sound plausible to you?
that might be that the way you're creating the PaymentMethod, you're creating it on the Platform account
BUT
your Subscription / Customer live on the connected accounts
so how are you creating the PaymentMethod? with Stripe.js?
i.e. CardElement?
yes
are you passing the stripeAccount: header when initializing Stripe.js?
I assume no
which would be the issue
here
's what I see (wrapping my head around new code)
this is in React
in a parent component, it calls loadStripe(apiKey, { stripeAccount })
it renders an Elements component from @stripe/react-stripe-js and inside that Elements components is a child component that calls useStripe(). This child is creating the payment method.
if something sticks out to you as the wrong way to do it, advice is welcome--otherwise I think this is implementation specific on my side and I can puzzle that out.
let's start here
what is the request ID for the request that returns
I'm also getting an API error message trying to change the payment method on the subscription, but I'm not sure if this is the same problem or something else I'm doing wrong. (Error says: "No such PaymentMethod: 'pm_XXXX'; OAuth key or Stripe-Account header was used but API request was provided with a platform-owned payment method ID. Please ensure that the provided payment method matches the specified account")
req_tVPPXZnKGdiqP6
ah I see, the way you're doing
in a parent component, it calls loadStripe(apiKey, { stripeAccount })
isn't right, AFAICT stripeAccount isn't being passed to Stripe.js correctly
cause PaymentMethod was created on the Platform
https://dashboard.stripe.com/test/logs/req_GPP4DTWAm5pSpF
this request, this should have happened on the connected account, not the Platform
your this request is OK: req_tVPPXZnKGdiqP6
just that the previous request to create the PaymentMethod was off