#pheirce_api

1 messages ยท Page 1 of 1 (latest)

crisp trenchBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1252370272984764458

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

fleet mirage
#

Hi there! Can you share what your frontend code looks like?

#

Is there a test environment you can link to where I can try to see this in action?

fervent raven
#

there isn't a site. i'm doing the coding locally as a prototype right now. the code is in an old school react component (class component) that is proprietary. i could post relevant snippets.

it's pretty clear that the component is configured correctly to show in the app since it does show a message when it fails to get a proper session.

#

(i obscured the api key in the curl call)

#
import { loadConnectAndInitialize } from '@stripe/connect-js'
import { ConnectNotificationBanner, ConnectComponentsProvider } from '@stripe/react-connect-js'

...

const fetchClientSecret = async () => {
  // Fetch the AccountSession client secret by making an API call to your service
  return 'accs_secret__QJPe845ytlkqhRS29nybTIpkeZgiDq8gOK11YiCAREdKN9m'
}

const connectInstance = loadConnectAndInitialize({
  publishableKey: 'pk_test_3GCSu6TixJkycXnKuk7yqaLp',
  fetchClientSecret: fetchClientSecret,
  appearance: {
    variables: {
      colorPrimary: '#228403', //optional appearance param,
    },
  },
})

...

  renderConnectToStripeCard = (user: AnnotatedUser, showCommercialOptions: boolean) => {
    const { impersonated } = this.props

    const userAccountType = UserService.getUserAccountType(user)

    /*
      test mode publishable key: pk_test_3GCSu6TixJkycXnKuk7yqaLp
      prod publishable key: pk_live_z2BtNEcGZ1ZFWX9peuGCUZSx

    */
    return (
      <ConnectComponentsProvider connectInstance={connectInstance}>
        <ConnectNotificationBanner />
        <Paper className="md:w-full p-6" elevation={0}>

...
#

CONNECTED_ACCT_ID=acct_1PC7kIGb5HQ01JiE; curl https://api.stripe.com/v1/account_sessions -u "sk_test_XXXX:" -d account=${CONNECTED_ACCT_ID} -d "components[notification_banner][enabled]"=true -d "components[notification_banner][features][external_account_collection]"=true

#

(sorry, i panicked when i saw the comments with the public keys.)

fleet mirage
#

And just to be clear, you're initializing the component with the correct Session client_secret ?

fervent raven
#

that is correct. in the code above you can see that i post the session key directly into the code in my dev testing phase now.

#

but nothing ever shows when there are restrictions on the connect account that was used to create the session

fleet mirage
#

As you mentioned earlier, sessions are short lived

fervent raven
#

i do see an error if i reload, as expected, because the session has already been used.

fleet mirage
#

I'm not a React expert so I'm getting some help from another teammate. Hang tight!

fervent raven
#

ty!

#

(in the meantime i'm setting up the fetchClientSecret to retrieve one each time from the account_sessions api)

foggy pawn
#

HI ๐Ÿ‘‹

I'm stepping in to help. I have an implementation of the Notification banner (in vanilla Stripe.js but it shouldn't matter too much). I'm getting a similar behavior as you are describing so I'm trying to test out some different options to see if I can trigger the banner to properly inflate (or hydrate of whatever verb we're using now).

fervent raven
#

thank you!

#

(inflate and hydrate are more creative than i deserve. i was just saying display.)

foggy pawn
#

Okay do you see any warnings in your console? I am getting

The account has not been onboarded yet, so the notifications banner will not render. Please finish onboarding to view the notifications banner.

so that is telling me why this account has no notifications

crisp trenchBOT
foggy pawn
#

Hmmm okay I just walked through onboarding another test account. I am no longer getting this warning but I'm still not seeing the banner

fervent raven
#

hrm. let me look

#

i'm not seeing anything related to stripe in the console.

kindred fossil
#

What requirements are on the Account you're testing with?

#

Anything in currently_due or eventually_due?

fervent raven
#

would i see that under Account information in the profile?

kindred fossil
#

You'd see it on the Account object. So you'd retrieve the Account using its ID

fervent raven
#

ok, one sec

#
"requirements": {
    "alternatives": [],
    "current_deadline": null,
    "currently_due": [
      "external_account",
      "tos_acceptance.date",
      "tos_acceptance.ip"
    ],
    "disabled_reason": "requirements.past_due",
    "errors": [],
    "eventually_due": [
      "company.tax_id",
      "external_account",
      "tos_acceptance.date",
      "tos_acceptance.ip"
    ],
    "past_due": [
      "external_account",
      "tos_acceptance.date",
      "tos_acceptance.ip"
    ],
    "pending_verification": []
  },
#
"future_requirements": {
    "alternatives": [],
    "current_deadline": null,
    "currently_due": [],
    "disabled_reason": null,
    "errors": [],
    "eventually_due": [],
    "past_due": [],
    "pending_verification": []
  },
kindred fossil
#

Huh...

#

Working with my colleagues to dig a bit more

fervent raven
#

ty

kindred fossil
#

Can you try the same setup with a different Connect account? We have a hypothesis that the Connect Account needs to have currently_due requirements and not be disabled.

fervent raven
#

ok, let me try

#
  "requirements": {
    "alternatives": [],
    "current_deadline": null,
    "currently_due": [
      "individual.address.city",
      "individual.address.line1",
      "individual.address.postal_code",
      "individual.address.state"
    ],
    "disabled_reason": null,
    "errors": [],
    "eventually_due": [
      "individual.address.city",
      "individual.address.line1",
      "individual.address.postal_code",
      "individual.address.state",
      "individual.dob.day",
      "individual.dob.month",
      "individual.dob.year",
      "individual.ssn_last_4"
    ],
    "past_due": [],
    "pending_verification": []
  },
#

fir account: acct_1PRcrqGhEvxMHzMW

#

shows up:

#

so that works

#

so i should expect it to work for non-disabled accounts?

kindred fossil
#

For now yes, but we're following up with the product team, because I can't think of a good reason for it to not work on disabled accounts.

fervent raven
#

agreed and ty!

#

thats gives me what i need for current prototype.