#jake-epping_code
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/1479050998419820558
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you share the code you're using that throws that error?
But fundamentally this looks like an integration error:
pm_1Sn3vUAElr0updKN2mHHiCK4exists onacct_1QRx0ZAElr0updKN- The request that errored (
req_TLz7I0X4ipIxrl) was thrown on a different account:acct_1RTiCOD8XMz5qkIj
Are you passing the stripeAccount param into loadStripe? https://docs.stripe.com/js/initializing#init_stripe_js-options-stripeAccount
yeah, but i have only one account at the same time on the client side.
const createPaymentResponse =
card && !createPaymentResFromDigitalWallet
? await stripe.createPaymentMethod({
type: 'card',
card,
billing_details: { name: name || '' },
})
: (createPaymentResFromDigitalWallet as PaymentMethodResult)
and then I call our API
const createSubscriptionResponse =
await paymentService.createSubscription({
cohort,
uuid,
planId,
trialPeriodDays: trialPeriod,
cpf,
paymentMethodId: createPaymentResponse.paymentMethod?.id,
})
That's required if you're a platform interacting with objects on connected accounts
Can you share the actual Stripe code from the backend?
Crucially I suspect your missing Stripe-Account header somewhere
Are you passing the stripeAccount param into loadStripe? https://docs.stripe.com/js/initializing#init_stripe_js-options-stripeAccount
No, only public key. As I understood stripe account is needed only for "Connect". not sure we are using it
If this is not a Connect integration then you must have mismatching API keys (different accounts) between frontend and backend
pm_1Sn3vUAElr0updKN2mHHiCK4 was created here using pk_xxx key from acct_1QRx0ZAElr0updKN
Your request that errors is using the key from acct_1RTiCOD8XMz5qkIj
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Give me a moment. I'll ask our backend developer about this
Unfortunately, I can’t share the backend code. However, the situation itself looks strange because we initialize the Stripe wrapper with the ID that we receive from the backend and that was assigned to the user. There should be no other ID present on the client side anywhere, yet it looks as if the payment method is being created for some other ID that we do not have.
It's the API key used to initialise the Stripe client(s). Nothing to do with the pm_xxx ID:
- You're using
loadStripewith the publishable key fromacct_1QRx0ZAElr0updKN. It generated the PM object on that account when you usecreatePaymentMethod - You're using
new Stripe(or whatever backend SDK) with the secret key fromacct_1RTiCOD8XMz5qkIj. It rightfully returns a 404 because the PM object doesn't exist on that account
Is this more likely a frontend issue or a backend issue?
I don't know as I don't know which is the correct account that you should be interacting with
got it. thanks a lot for your time, I'll check this on my side
It looks as frontend issue. Below the information from backend dev
The payment_method pm_1SzRTuDQXIH6jrJbPlyt6ST1 was supposed to be created on account acct_1Nfh9jJGRf7IzK7P, but it was created on acct_1QHkWbDQXIH6jrJb instead. However, the customer belongs to acct_1Nfh9jJGRf7IzK7P.
👋 Hey, taking over here, just taking a look