#jowthejow_code

1 messages ยท Page 1 of 1 (latest)

chrome ospreyBOT
#

๐Ÿ‘‹ 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/1309228798067216424

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

warm yarrow
#

Hi ๐Ÿ‘‹ I'm not sure I understand. You mention that this works as expected when using your testmode publishable API key, correct? What do you change to then have it not work?

worldly isle
#

Nothing, I just went live hosting on vercel... I added the live API key and the components don't appear...

#

I tried deleting that user and creating a new one and now got another error, related to discussion I had with your collegue yesterday

#

exports.createAccount = async (req, res) => {
try {
const { email } = req.body;

const account = await stripe.accounts.create({
  capabilities: {
    card_payments: { requested: true },
    transfers: { requested: true },
  },
  country: "BR",
  type: "custom",
  email: email, // Add email to the account creation
  settings: {
    branding: {
      //For Live:
      icon: "file_1QNPXsHIfwP9MV0C2Xdd9VEh",
      logo: "file_1QNPWaHIfwP9MV0C8cj9Br3k",
      primary_color: "#9500ff",
      secondary_color: "#9500ff",

      //For test:
      // icon: "file_1QNPX4HIfwP9MV0CP09OkvUA",
      // logo: "file_1QNPYgHIfwP9MV0CuOsHAh69",
      // primary_color: "#9500ff",
      // secondary_color: "#bd75f0",
    },
  },
});

// Return account id
return { account: account.id };

} catch (error) {
console.error("Error creating Stripe account:", error);
res.status(500).json({ error: error.message });
}
};

#

Please help

#

Third day on this "hat file is already attached to something else" issue

warm yarrow
#

Do you have the ID of the failed request? (should have an req_ prefix)

Does the error subside if you create a new file that hasn't already been used, and use that in the account creation request instead?

worldly isle
#

humm, you say add the same file on every account creation and then attach the fileId to the settings?

#

req_giUAucTF9EnTnP

warm yarrow
#

Yeah, that's my thinking. Taking a look at the request.

worldly isle
#

Ok ill try that

worldly isle
#

It worked ๐Ÿ™‚

#

Thanks Toby

warm yarrow
#

Awesome, glad to hear!

#

Were you able to get to the bottom of the publishable key behavior too?

worldly isle
#

Yes, it just worked...

#

Maybe my env took some time to update in the backend

warm yarrow
#

Gotcha, just wanted to make sure I didn't leave anything unasnwered.