Stripe - can we dynamically enable options?

Is it possible to enable options like these:

Based on a variable (for example: a database query that outputs if this particular check-out should have Automatic Tax enabled)

I don’t see any other way right now than creating a lot of duplicates with a little bit different settings - and trigger them based on conditions. That would become hard to maintain

Your observation here is correct.

I haven’t used stripe in Wappler at all, but if other modules are any indication, you can just duplicate the original module’s code and create your own custom module with those options available via dynamic binding.

So what you are asking is if you can use serverDataBindings: true in the hjson for a checkbox input, right? Nope.

Actually weird stuff happens if you try.

image

Well the end result I’m going for is something like being able to pass a true next to a checkbox input and then:

  • If true enable checkbox
  • If false or not set disable checkbox

The ‘on’ in your screenshot is what happened when you added serverDataBindings: true ?

@sid Hmm I could do that again but do you see a way of doing that after seeing Jon’s point?

1 Like

Sorry the Stripe enabler options on the server connect UI aren’t dynamic. Usually you don’t need them to be as you decide in design time what to enable or not.

Maybe in the future we can make some kind of combo control that you can switch between checkbox or dynamic field as value.

You’re reading it wrong. Its just a suggestion that having dynamic picker on checkbox is not supported.
Or maybe Jonas did not get my point.

When I say setting up a custom module - it would mean you will be replacing those checkboxes with an input field with dynamic picker in HJSON. And modify the JS code to work based on the value there, instead of the current true/false setup of checkbox.

1 Like

Thanks for the idea - I might give it a try, I’ll start with a bunch of if statements and see how maintainable it will be!

@George for your consideration, let me explain my use case:
It’s a SaaS application. We’re using Stripe Connect. So for example, we want to support ‘Stripe Tax’. We will let our clients (who have Stripe Standard Accounts) decide if they want to use it.
IF yes: they need to enable it in their Stripe dashboard, and then WE need to tick the ‘Automatic Tax → Enabled’ checkboxes in the server connect module here: image

Right now if they do not have stripe tax enabled, but we DO enable it in the SC module… it will throw an error when trying to create the check out session: “stripe tax needs to be enabled”

So it would be great to allow our customers to set these options, you’re right that it wouldn’t be necessary if it’s just our own check out where we can decide once what we want to enable and disable.

This would improve Wapplers stripe support for SaaS applications a lot! (Just like you added the advanced options)

PS If you’re interested, I can create a clear list of current limitations with Wapplers stripe support for SaaS use cases (there’s more with webhooks and also with the client -side components)

2 Likes

That’s now possible in Wappler 6.4.1

This topic was automatically closed after 46 hours. New replies are no longer allowed.