#ojotule-_error

1 messages · Page 1 of 1 (latest)

polar spearBOT
#

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

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

blissful mirage
#

[
"@stripe/stripe-react-native",
{
"merchantIdentifier": "merchant.com.chor.chor",
"enableGooglePay": true
}
],

old totem
#

Hi! Can you get the logs from the iOS device and share those please?

blissful mirage
#

const AppProvider = () => (
<StripeProvider
publishableKey={process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE!}
stripeAccountId="b"
merchantIdentifier="merchant.com.chor.chor"
urlScheme="myapp"

<Provider store={store}>
  <RootLayout />
</Provider>

</StripeProvider>
);

export default Sentry.wrap(AppProvider);

old totem
old totem
#

How sure are you the code you shared above is what's actually running on the device?

#

Can you just grab the logs off the iOS device you're testing this on, and share the logs related to / located around this error?

blissful mirage
#

I’m actually distributing the app via TestFlight right now, so I can’t attach it to Xcode directly to grab live device log

#

my local Xcode can’t open the workspace generated by the latest Stripe SDK & Expo setup.

old totem
#

But odds are pretty good that somehow the value you're providing in the <StripeProvider> isn't making it into the deployed code.

#

Oh. Try changing it to something silly like com.example.definitely.broken. You should get a different error indicating that it's wrong, rather than missing. If you don't, there's a deployment flow issue. If you do, then try switching it back and redeploying.

blissful mirage
# old totem https://developer.apple.com/documentation/xcode/acquiring-crash-reports-and-diag...

Thanks for that note here’s exactly how I’m instantiating StripeProvider in my production build:
function RootLayout() {

const merchantId = Constants.expoConfig?.plugins?.find(
(p) => p[0] === "@stripe/stripe-react-native"
)?.[1].merchantIdentifier;

// const stripePlugin = Constants.expoConfig?.plugins?.find(
// (p) => Array.isArray(p) && p[0] === "@stripe/stripe-react-native"
// );

// const merchantId = stripePlugin
// ? stripePlugin[1]?.merchantIdentifier
// : undefined;

console.log("merchantId", merchantId);
console.log(
"publishableKey",
process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE
);

if (!merchantId) {
throw new Error(Missing Expo Config for "@stripe/stripe-react-native");
}

return (
<PersistGate loading={null} persistor={persistor}>
<PaperProvider>
<StatusBar backgroundColor="white" barStyle="default" />
<Slot />
<Toast />
</PaperProvider>
</PersistGate>
);
}

const AppProvider = () => (
<StripeProvider
publishableKey={process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE!}
// merchantIdentifier={merchantId}
// urlScheme={Linking.createURL("/")?.split(":")[0]}
stripeAccountId="xxxxx"
merchantIdentifier="merchant.com.chor.chor"
urlScheme="myapp"

<Provider store={store}>
  <RootLayout />
</Provider>

</StripeProvider>
);

export default Sentry.wrap(AppProvider);

old totem
#

You've commented out merchantIdentifier.

#

(and urlScheme)

blissful mirage
old totem
#

You told me the code you shared was exactly how you were doing it, and I pointed out that exactly how you were doing it has those two things commented out; then you said you add them 'below directly' (I don't know what that means).

Those two statments are logically inconsistent.

#

Can you paste the entire file, exactly as it is deployed to/through TestFlight?

blissful mirage
#

ok

old totem
#

Ok I see what you mean now, thank you.

Can you change the <StripeProvider> part to look like this, and try again? I don't think it'll matter, but let's eliminate anything that might be misbehaving:

  <StripeProvider
    publishableKey={process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE!}
    merchantIdentifier="merchant.com.chor.chor"
    urlScheme="myapp"
  >
    <Provider store={store}>
      <RootLayout />
    </Provider>
  </StripeProvider>
old totem
#

How'd it go?

blissful mirage
#

building..

polar spearBOT
blissful mirage
#

🤦‍♂️ I am still getting the same error..

old totem
#

Can you change it to something ridiculous and see if you get a different error?

blissful mirage
#

ok...

old totem
#

I have to run but solanum can hopefully better guide you here. 😅 Cheers!

polar spearBOT
exotic estuary
#

hmm, i see you've already stated that you're not able to build directly from xcode, i was going to suggest trying that to see if you're able to load it onto your device directly from xcode

blissful mirage
#

hi solanum

#

could you recommend another approach i could use please?

exotic estuary
#

hello! this might be beyond my current knowledge of our react native SDKs... let me poke around for a bit but i might need to see if i can pull in someone with a little more react native experience than me

blissful mirage
#

ok

exotic estuary
#

ok, so digging through where we throw this error in the code, it looks like this only occurs when we get a null value for your merchant identifier

#

so clearly when the app is trying to run on your phone that value is not being set in the StripeProvider somehow or another. i am still struggling to understand how that would be the case

#

i'm not super familiar with test flight so i might just ask you to try some things... can you make some other random change, like altering a string in the same file, and verify that that shows in the app you're running on your phone? just to sanity check that you are running exactly what you think you are

#

or like... just display the merchant identifier as a string to verify it exists

#

if it definitely exists and is definitely being passed to the StripeProvider then we have something very odd going on

blissful mirage
#

ok... let me try that

exotic estuary
#

hello! just want to check in here. normally we close threads after a period of inactivity but i want to make sure you're not still working through my last suggestions right now