#caderann_unexpected

1 messages Β· Page 1 of 1 (latest)

charred peakBOT
#

πŸ‘‹ 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/1491418014716006591

πŸ“ 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.

mellow axle
#

image reference:

#

setup_intent_id: seti_1TJuv3AXSZpEHfLwfD19NwzB

queen trout
#

πŸ‘‹ Hi there! Let me take a look

#

I can see some requests being made from the app that are possibly not being made via the connected account

#

Are you setting the stripeAccount value for the connected account in your Android code?

#

Can you share how you're setting the publishable key and Stripe account ID in your code?

charred peakBOT
mellow axle
#

the publishable key and stripeAccount are set through the stripe provider, please allow me some time while i share the code snippet

hushed solar
#

πŸ‘

mellow axle
#
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import { persistor, store } from './app/store/store';
import getEnv from './app/config/environment';
import { StripeProvider } from '@stripe/stripe-react-native';
import { useSelector } from 'react-redux';


Text.defaultProps = {};
Text.defaultProps.allowFontScaling = false;
TextInput.defaultProps = {};
TextInput.defaultProps.allowFontScaling = false;
TextInput.defaultProps.underlineColorAndroid = 'transparent';

const threeDSecureParams = {
  backgroundColor: '#FFFFFF', // iOS only
  timeout: 5,
  label: {
    headingTextColor: '#000000',
    headingFontSize: 13,
  },
  navigationBar: {
    headerText: '3D Secure',
  },
  footer: {
    backgroundColor: '#FFFFFF', // iOS only
  },
  submitButton: {
    backgroundColor: '#000000',
    cornerRadius: 12,
    textColor: '#FFFFFF',
    textFontSize: 14,
  },
};

const AppWithStripe = () => {
  const stripeSession = useSelector((state) => state.payment.stripeSession);
  const ENV = getEnv();

  return (
    <StripeProvider
    stripeAccountId={stripeSession?.stripe_account_id}
    publishableKey={ENV.STRIPE_KEY}
    urlScheme={ENV.url_prefix}
    threeDSecureParams={threeDSecureParams}
    merchantIdentifier={ENV.merchantId ?? undefined}
  >
    {/* App specific code */}
  </StripeProvider>
  );
};

export default function App() {
  const AppContent = (
    <Provider store={store}>
      <PersistGate loading={null} persistor={persistor}>
        <AppWithStripe />
      </PersistGate>
    </Provider>
  );

  return AppContent;
}
#

we are using react-native, so the code is the same for iOS as well as android

#

FYI: package version @stripe/stripe-react-native": 0.45.0

hushed solar
#

Hello
That is indeed interesting that it works for iOS but not for Android

#

The SetupIntent you've shared, I don't see any confirmation request on it

#

Does this work if you create the SetupIntent on the Platform without a ConnectedAccountID set and removing stripeAccountId from the client-side parameters?

mellow axle
#

the confirmation response looks like this (this snippet is from another failing setup intent request):

{
  "error": {
    "code": "resource_missing",
    "doc_url": "https://stripe.com/docs/error-codes/resource-missing",
    "message": "No such setupintent: 'seti_1THJoQAXSZpEHfLwW6p1zRNN'",
    "param": "intent",
    "request_log_url": "https://dashboard.stripe.com/acct_1DHUSEAk5RfErHut/test/workbench/logs?object=req_nLVpDtPQNsQvuo",
    "type": "invalid_request_error"
  }
}
#

cURL

curl 'https://api.stripe.com/v1/setup_intents/seti_1THJoQAXSZpEHfLwW6p1zRNN?client_secret=seti_1THJoQAXSZpEHfLwW6p1zRNN_secret_UFpTLTHy8xWLFHNCtm2gL77RxtEOtMn' \
-H 'Accept: application/json' \
-H 'Stripe-Version: 2020-03-02' \
-H 'Authorization: Bearer pk_test_FKk1RTSHzHTBnmEoE5YeehHM' \
-H 'X-Stripe-Client-User-Agent: {"os.name":"android","os.version":"36","bindings.version":"21.12.0","lang":"Java","publisher":"Stripe","http.agent":"Dalvik\/2.1.0 (Linux; U; Android 16; sdk_gphone64_arm64 Build\/BE4B.251210.005)","application":{"name":"@stripe\/stripe-react-native\/expo","version":"0.45.0","url":"https:\/\/github.com\/stripe\/stripe-react-native","partner_id":"pp_partner_JBN7LkABco2yUu"}}' \
-H 'Accept-Language: en-US' \
-H 'User-Agent: Stripe/v1 AndroidBindings/21.12.0 @stripe/stripe-react-native/expo/0.45.0 (https://github.com/stripe/stripe-react-native)' \
-H 'Accept-Charset: UTF-8' \
-H 'X-Stripe-User-Agent: {"lang":"kotlin","bindings_version":"21.12.0","os_version":"36","type":"Google_google_sdk_gphone64_arm64","model":"sdk_gphone64_arm64","name":"@stripe/stripe-react-native/expo","version":"0.45.0","url":"https://github.com/stripe/stripe-react-native","partner_id":"pp_partner_JBN7LkABco2yUu"}' \
-H 'Host: api.stripe.com' \
-H 'Connection: Keep-Alive'
#

and also non-bank payments methods are getting added successfully

hushed solar
#

Yeah that No such setupintent error points to your code using the wrong API key due to a missing CoonectedAccountId

#

Esentially, the SDK is trying to look for for the SetupIntent on Platform account but it exists on the Connected Account

mellow axle
#

if that was the case, how is the iOS integration working correctly with the same code?

hushed solar
#

If I had to make an educated guess, there's some race condition that's modifying your StripeProvider parameters and your code/network is just somehow running faster on iOS than android

mellow axle
#

and how are the other payment methods getting attached succesfully?

#

I'll share some console logs from the android app, can you please help me confirm the value match with what the stripe API expects?

hushed solar
#

sure

mellow axle
#

please allow me 5 minutes while i replicate the issue

hushed solar
#

Also looking at your cURL request again, it is missing Stripe-Account parameter in the header

mellow axle
#

the cURL request i've shared is sent by the SDK automatically, we are not sending it via code

hushed solar
#

Gotcha in that case that confirms the missing Connected Account ID in the request

#

so there's really something in your code that's resetting the parameters you're passing to StripeProvider

mellow axle
#

okay, let me share the request we generate from backend

hushed solar
#

Yup, since you passed the Stripe-Account header - the SetupIntent belongs to acct_1OybGXAXSZpEHfLw account

#

So when you confirm, that account ID needs to be present in the confirmation request header

mellow axle
#

we are setting it in the provider, otherwise it would not work for iOS and non-bank payment methods as well, correct?

hushed solar
#

Yeah but something in your code is clearly removing it based on the cURL request you shared

#

Are you configuring StripeProvider parameters dynamically? Like is it dependent on a State variable?

#

If so, that could create issues

#

Can you hard code the Connected Account ID in

    stripeAccountId="acct_1OybGXAXSZpEHfLw"
    publishableKey={ENV.STRIPE_KEY}
    urlScheme={ENV.url_prefix}
    threeDSecureParams={threeDSecureParams}
    merchantIdentifier={ENV.merchantId ?? undefined}
  >
    {/* App specific code */}
  </StripeProvider>```
mellow axle
#

let me try hardcoding it

charred peakBOT
mellow axle
hushed solar
#

I don't see any confirmation request on this SetupIntent so I guess it's expected not to work

mellow axle
#

we've confirmed it from the UI

#

let me share a screen recording

hushed solar
#

What publishable key are you setting? Platform's or the Connected Accounts?

mellow axle
#

PUBLISHABLE_KEY: pk_test_FKk1RTSHzHTBnmEoE5YeehHM our Platform's key

pale heath
#

Hello, I'm taking over for hanzo who had to step away. Please give me a few minutes to catch up πŸ™‚

mellow axle
#

sure

pale heath
#

Ok I see that you're creating the SetupIntent seti_1TJwpdAXSZpEHfLwDRSDmYnD with the platform's key and the connected account's ID but I'm not seeing any related request to confirm it. Is this what's failing?

mellow axle
#

actually we are not seeing any confirmation requests in the workbench, even for setup_intents where the payment method is getting attached to the customer successfully

#

the main issue is that we are not able to link bank accounts via ACH through setup_intents

#

non-bank payment methods like cards are getting added without any issues

pale heath
#

It's strange that this works for non-bank payment methods... can you share a request or SetupIntent ID for one of those for me to compare?

mellow axle
pale heath
#

I see this SetupIntent also created with the platform's key and the connected account's ID, then it is confirmed. Are you able to pinpoint why your code isn't making a confirm request when using bank payment methods? What step is it getting stuck on?

Ah, from the video, I can see that you're unable to add the bank account after connecting to it. Is there a request to attach that payment method to the Customer?

mellow axle
#

yes, that request cURL is attached above:

curl 'https://api.stripe.com/v1/setup_intents/seti_1THJoQAXSZpEHfLwW6p1zRNN?client_secret=seti_1THJoQAXSZpEHfLwW6p1zRNN_secret_UFpTLTHy8xWLFHNCtm2gL77RxtEOtMn' \
-H 'Accept: application/json' \
-H 'Stripe-Version: 2020-03-02' \
-H 'Authorization: Bearer pk_test_FKk1RTSHzHTBnmEoE5YeehHM' \
-H 'X-Stripe-Client-User-Agent: {"os.name":"android","os.version":"36","bindings.version":"21.12.0","lang":"Java","publisher":"Stripe","http.agent":"Dalvik\/2.1.0 (Linux; U; Android 16; sdk_gphone64_arm64 Build\/BE4B.251210.005)","application":{"name":"@stripe\/stripe-react-native\/expo","version":"0.45.0","url":"https:\/\/github.com\/stripe\/stripe-react-native","partner_id":"pp_partner_JBN7LkABco2yUu"}}' \
-H 'Accept-Language: en-US' \
-H 'User-Agent: Stripe/v1 AndroidBindings/21.12.0 @stripe/stripe-react-native/expo/0.45.0 (https://github.com/stripe/stripe-react-native)' \
-H 'Accept-Charset: UTF-8' \
-H 'X-Stripe-User-Agent: {"lang":"kotlin","bindings_version":"21.12.0","os_version":"36","type":"Google_google_sdk_gphone64_arm64","model":"sdk_gphone64_arm64","name":"@stripe/stripe-react-native/expo","version":"0.45.0","url":"https://github.com/stripe/stripe-react-native","partner_id":"pp_partner_JBN7LkABco2yUu"}' \
-H 'Host: api.stripe.com' \
-H 'Connection: Keep-Alive'
#

this request is failing with this error:

{
  "error": {
    "code": "resource_missing",
    "doc_url": "https://stripe.com/docs/error-codes/resource-missing",
    "message": "No such setupintent: 'seti_1THJoQAXSZpEHfLwW6p1zRNN'",
    "param": "intent",
    "request_log_url": "https://dashboard.stripe.com/acct_1DHUSEAk5RfErHut/test/workbench/logs?object=req_nLVpDtPQNsQvuo",
    "type": "invalid_request_error"
  }
}

From what i can understand, this request is being triggered by SDK internally

pale heath
#

Sorry for the delay! I've been juggling a few threads.

#

Thank you for clarifying. As my colleague had explained earlier, the reason that request is failing is because the SetupIntent exists on the connected account but there is no Stripe-Account header with the connected account ID. Here is that request if you want to take a look in your dashboard: https://dashboard.stripe.com/acct_1DHUSEAk5RfErHut/test/logs/req_nLVpDtPQNsQvuo

So the question becomes, what is triggering that request and why doesn't it have the Stripe-Account header?

Can you share your code for collecting the payment method details? Are you using the PaymentSheet component or something else?

charred peakBOT
mellow axle
#

we are using the setup intent, not the payment sheet

#

isn't this request triggered by your SDK?

#

clarification: we are using the PaymentSheet

#

const { initPaymentSheet, presentPaymentSheet } = useStripe();

#

Hi @lapis siren can you please help us out here, this has been raised by a live stripe connect client of ours

lapis siren
#

yep! sorry, catching up on the thread now

lapis siren
#

still digging into this

#

i might need to convert this to an email case to dig into it further - i haven't been able to reproduce the issue myself yet. would it be possible to move this to email and for you to share a minimal app with me in which you can consistently reproduce the issue?

mellow axle
#

sure, ill try to create an app for the same with hardcoded credentials

charred peakBOT
#

Hello @mellow axle, we have sent you a direct message, please check it at https://discord.com/channels/@me/1387463199862952159

  • πŸ”—The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
lapis siren
#

i just sent you a link to create a case, feel free to lmk when you've filled that out

#

it will take you to our regular support site but if you click contact support it will bypass the regular bot and just ask for some minimal info

mellow axle
#

sure, I've filled it and raised a ticket, I'll make sure to share the repro as a reply to the acknowledgement email

lapis siren
#

i got the ticket! i'll keep an eye out for your followup πŸ™

mellow axle
#

thanks for your help!

lapis siren
#

yep! appreciate your patience and hopefully we can get to the bottom of this soon

#

AHH wrong emoji

#

was going for 🀞