#abdul-ahad_api

1 messages ¡ Page 1 of 1 (latest)

dry caveBOT
#

👋 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/1372469677800030271

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

placid geyser
#

Hi there, are you using PaymentSheet to confirm a payment created on a connected account?

dreamy widget
#

Yes

placid geyser
#

I see, when you create the ephemeral key, did you also pass the connected account in the Stripe-Account header?

dreamy widget
#

Sorry, can you clarify what a connected account?

#

Let me check

#
    customerId: string;
  }): Promise<Stripe.EphemeralKey> {
    try {
      const ephemeralKey = await this.stripe.ephemeralKeys.create(
        {
          customer: params.customerId,
        },
        { apiVersion: "2025-04-30.basil" }
      );

      this.logger.log(
        `StripeService.createEphemeralKey: Created ephemeral key for customer ${params.customerId}`
      );
      return ephemeralKey;
    } catch (error) {
      this.logger.error(
        `StripeService.createEphemeralKey: Failed to create ephemeral key for customer ${params.customerId}`,
        error
      );
      throw error;
    }
  }```
#

This is my backend code

#

using test account for now

placid geyser
#

Ok, can you share with me the ID of the paymentIntent

dreamy widget
#

you mean payment intend id?

placid geyser
#

Yes

dreamy widget
#

{
"id": 4,
"createdAt": "2025-05-15T01:20:14.371Z",
"updatedAt": "2025-05-15T01:20:14.371Z",
"deletedAt": null,
"stripePaymentIntentId": "pi_3ROvcSL7xBeUccvj1MYycmK2",
"paymentIntentClientSecret": "pi_3ROvcSL7xBeUccvj1MYycmK2_secret_J1Ifl5jSukwyfaeQNzGqZECkE",
"ephemeralKeySecret": "ek_test_YWNjdF8xUVdiS0lMN3hCZVVjY3ZqLGxuMEt3RHljbEc3WXVnZjJSeU1QdEREV0YyVjY3bjg_00wDszAkS8",
"type": "ORDER",
"status": "PENDING",
"amount": "19.39",
"commissionAmount": null,
"failureReason": null,
"stripeTransferId": null,
"orderId": 4,
"agentId": null
}

placid geyser
#

Ok, so you paymentIntent and ephemeral key were created on a different account than acct_1QWbKIL7xBeUccv

#

You'll want to make sure your react-native SDK is initialized with the correct publishable key

dreamy widget
#

I dont understand the publishable key is same on both ends

#

Let me share a part of it

#

import React from "react";
import { Provider } from "react-redux";
import AppNavigator from "./src/navigation/AppNavigator";
import store from "./src/redux/store";
import { StripeProvider } from "@stripe/stripe-react-native";
// import NotificationHandler from "./src/contexts/NotificationHandler";

const PUBLISHABLE_KEY =
"pk_test_51QWbKIL7xBeUccvjmco**********TU3JNVrYD600job0oEG5";

const App = () => {
return (
<Provider store={store}>
<StripeProvider
publishableKey={PUBLISHABLE_KEY}
merchantIdentifier="merchant.com.vamoose.app"
>
{/* <NotificationHandler> /}
<AppNavigator />
{/
</NotificationHandler> */}
</StripeProvider>
</Provider>
);
};

export default App;

placid geyser
#

So basically you are using the publishable key of acct_1QWbKIL7xBeUccvj on your react-native app, but on your backend, the API secret key belongs to a different account.

dreamy widget
#

I just checked they are the same

#

Confirmed in backend frontend and also stripe account

placid geyser
#

Ok, sorry my mistake, let me check again.

dreamy widget
#

No worries

placid geyser
#

Where do you get this error from? is it from initPaymentSheet ?

dreamy widget
#

I just checked logs, when getting the payment_methods the api key shows different here

#

let me share the screenshot

#

Well my bad itt is the ek key

#

Yes when trying to open the sheet

#

Can you help me out

placid geyser
#

Can you share with me one of the request IDs (req_xxx) ?

dreamy widget
#

Sure

#

req_L3aUbfuPHKi3Sh

#

I think i got it

#

i am not passing stripe customer Id

#

which is causing the issue

#

let me try it once

#

Hey it is working now thank you soo much

placid geyser
#

I see, glad to know that your problem is solved.