#jbin_api
1 messages Β· Page 1 of 1 (latest)
π 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.
- jbin_api, 1 day ago, 30 messages
Hi there! What do you mean by "custom rules"?
In the payment methods dashboard - "Customize availability"
Hmm, I wonder if this applies to SetupIntents
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?
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
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
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?
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.
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
Welp sorry for taking up your time on that - but thank you for the help!
no problem, that's what we're here for!
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
There isn't a currency with SetupIntents, though, so I think you'd have to pass the currency option to the Elements instance
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)
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
Are you sure? We document it here: https://docs.stripe.com/js/elements_object/create#stripe_elements-options-currency
Hm interesting - I'm basing that off the typescript definition
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?
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?
I was able to reproduce; I can take it up with our team
π great thank you. Anywhere I can track that?
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.
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