#jbin_api

1 messages Β· Page 1 of 1 (latest)

brisk breachBOT
#

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

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

remote kiln
#

Hi there! What do you mean by "custom rules"?

brittle sundial
#

In the payment methods dashboard - "Customize availability"

remote kiln
#

Hmm, I wonder if this applies to SetupIntents

brittle sundial
#

That's what I'm wondering too πŸ˜ƒ . For context on why I'd like this - I have a form for collecting user's payment methods that we can later charge their invoices against. These rules are important for only allowing users the ability to add certain payment methods based on their configuration, so filtering them out is pretty important. Is there another way to fetch the available payment methods given a customer, location, and currency?

remote kiln
#

Generally if you're using Elements, Stripe abstracts the filtering of payment methods, but Stripe is designed to display the maximum number of available payment methods

brittle sundial
#

Yea I'm using Elements, but for the example user in this case (currency set to GBP, location set to UK) - they're still seeing the sepa_debit method on the form, even though the rule is supposed to exclude customers not using EUR and not in Germany

remote kiln
#

In my testing this works just fine for SetupIntents

#

How much time elapsed between you setting these controls and creating this SetupIntent? Could you try creating a fresh SetupIntent?

brittle sundial
#

Oh wow actually it looks to be working now. I tried a few times over a minute or 2 after changing the config, but I guess I should have waited longer πŸ˜₯. I see the SetupIntent object still has the extra payment methods on it, but it looks like the Elements are filtering them out.

remote kiln
#

Yeah I had just come to the same conclusion - the filtering happens on the frontend

#

which is the only thing I paid attention to at first

#

but all's well that ends well

brittle sundial
#

Welp sorry for taking up your time on that - but thank you for the help!

remote kiln
#

no problem, that's what we're here for!

brittle sundial
#

One additional thing I notice - I think this only works based on the location rule. I don't seem to be able to get the currency rule to work

remote kiln
#

There isn't a currency with SetupIntents, though, so I think you'd have to pass the currency option to the Elements instance

brittle sundial
#

I thought it would be based on the customer's configured currency. Though either way - for stripe elements with React, currency isn't a valid prop on the "Elements" component (unless client secret is excluded)

remote kiln
#

We may not be looking at that, since a Customer might have a particular currency but they could still be charged in a different currency for one-off payments

brittle sundial
#

Hm interesting - I'm basing that off the typescript definition

remote kiln
#

I think the TS types for stripe-react.js aren't always super up to date

#

You should be able to ignore the type error here

#

did you add @stripe/stripe-js as a dependency for the project?

brittle sundial
#

Yep, that at 7.3.0 and @stripe/react-stripe-js at 3.7.0

#

Ignoring the TS error seems to help - thanks. Can I file an issue around the typing? If so - could you point me to the correct place?

brisk breachBOT
remote kiln
#

I was able to reproduce; I can take it up with our team

brittle sundial
#

πŸ™ great thank you. Anywhere I can track that?

brisk breachBOT
#

Hello @brittle sundial, we have sent you a direct message, please check it at https://discord.com/channels/@me/1382847794598907964

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

Our bot just sent you a dm with instructions on opening a case. If you do so, someone will follow up with you about this