#guccisofloppy

1 messages · Page 1 of 1 (latest)

pastel tendonBOT
supple shard
#

Hi 👋 I've never heard of activating an account causing a change to the API version before.

worn basin
#

interesting. So, this app has been in development for awhile, and we're approaching a time to launch. I stepped through activation with the company's president, and after that we started seeing 401 errors coming from the React SDK integration. After a bit of bug-hunting, we noticed that on the developer dashboard, we're now getting API hits for 2022-11-15, but our server-side integration sets the API version at 2020-08-27. We're just unsure how that discrepency occured...

#

are keys tied to the API version?

supple shard
#

No, they're tied to accounts. Do you have an example of a request that was made with an API version other than what you were expecting that you can share?

worn basin
#

possibly... is there a way to filter the logs by API version?

#

nevermind, found one

#

req_m0gbR5jWiZcAgR

supple shard
supple shard
worn basin
#

awesome, this is what we were looking for

#

it looks like we are initalizing this from a config.json file, is that "normal" and are there docs for that?

supple shard
#

I'm not sure what you mean about initialiazing JS code from a json file.

worn basin
#
//BillingDetails.js
...
import { loadStripe } from "@stripe/stripe-js/pure"
import {
    Elements,
    PaymentElement,
    useElements,
    useStripe,
} from "@stripe/react-stripe-js"
import StripeConfig from "../../../config/stripe.config.json"

...

export default function BillingDetails() {
  const stripePromise = loadStripe(StripeConfig.perishable_key)
  ...
  //do other stripe things
}
#

I think the "perishable_key" is the "public_key"

#
//stripe.config.json
{
    "perishable_key": "pk_test_51Mmxxxxxxxxxxxxxxxxx"
}
supple shard
#

Ah you're using React, you'll pass the API version into the loadStripe function instead

pastel tendonBOT
worn basin
#

sweet! Thanks, that did fix the API version inconsistency! It didn't fix our errors, but we now think that's due to our React implimentation. Thanks so much for your help!!!

supple shard
#

Awesome! Sorry that wasn't the cureall, but glad to hear it's moving you in the right direction!