#taraxe_code

1 messages · Page 1 of 1 (latest)

vapid ingotBOT
#

👋 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/1392146344344551436

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

brisk flame
vapid ingotBOT
glad herald
#

Hello, looking into whether this is customizable. Can you tell me more about what you are trying to customize the text to?

brisk flame
#

the highlighted text on this screenshot, to an arbitrary text value (default value comes from Stripe I guess)

glad herald
#

Gotcha, and what would you like it to say instead?

brisk flame
#

"Enregister la carte pour plus tard"

#

we do healthcare, we cannot talk about "purchase" as in default label (here translated in French)

#

but it does not seem supported from what I could read in the docs

glad herald
#

I am not seeing a way to do this either. We are generally pretty limited in how much our UI strings can be customized because it can be abused for certain scams.
As a workaround, you can turn off that functionality for the payment element, add your own checkbox UI + message, and set or unset the intent's setup_future_usage and allow_redisplay properties based on whether the box is checked or not. I understand that that isn't ideal but that is the only way that I am aware of to display your desired save message at the moment.
Also I can file feedback about this. When you say you can't talk about a purchase, is that a regulation or moreso that the wording is inappropriate? I'll file this any which way but that could be helpful context to provide.

brisk flame
#

It's not regulatory, it just sounds inappropriate in healthcare to talk about purchase

glad herald
#

Gotcha, good to know. I saw something similar recently with our English wording where we said "order". Makes sense in a lot of contexts but for use cases like yours it is very confusing.

brisk flame
#

regarding your workaround, I'm not even sure we can achieve this in our current setup (cause we rely on a customerSesssionClientSecret setup on backend).

#

to display previous payment methods and show this checkbox on new card input

#
    mode: 'payment',
    currency: stripeParameters?.currency?.toLowerCase(),
    amount: stripeParameters?.centesimalValue, // amount required with payment mode
    paymentMethodCreation: 'manual',
    paymentMethodTypes: stripeParameters?.paymentMethodTypes,
    customerSessionClientSecret: stripeParameters?.customerSessionClientSecret,
    appearance: {
      variables: {
        colorPrimary: color.PRIMARY,
        colorDanger: color.ALERT,
      },
    },
  };```
glad herald
#

Good point, it may be more effort than it is worth in general. I think it would be possible because payment_method_redisplay and payment_method_save are separate features. So you could turn on redisplay but keep saving off, we'd show the saved PMs but there wouldn't be a checkbox. But then you would need to also do things like subscribe to the element's change event to hide that checkbox when a saved PM is selected

brisk flame
#

if I add a varying setupFutureUsage to these options, it shows just a disclaimer at the bottom (but I'll have to remove the customerSessionClientSecret to get rid of save PMs and the checkbox)

#

so I understand I'll have to handle the checkbox myself manually, but what if I want to show previously saved PMs too

#

here is how to customerSessionClientSecret is forged on the backend:

public Single<CustomerSession> createCustomerSession(
      LoggingContext context, StripeCustomerId customerId) {
    RequestOptions requestOptions = getRequestOptions();

    CustomerSessionCreateParams.Builder builder = getCustomerSessionCreateBuilder(customerId);

    CustomerSessionCreateParams.Components.PaymentElement.Features.Builder featuresBuilder =
        CustomerSessionCreateParams.Components.PaymentElement.Features.builder()
            .setPaymentMethodRedisplay(
                CustomerSessionCreateParams.Components.PaymentElement.Features
                    .PaymentMethodRedisplay.ENABLED)
            .setPaymentMethodSave(
                CustomerSessionCreateParams.Components.PaymentElement.Features.PaymentMethodSave
                    .ENABLED)
            .setPaymentMethodSaveUsage(
                CustomerSessionCreateParams.Components.PaymentElement.Features
                    .PaymentMethodSaveUsage.ON_SESSION)
            .setPaymentMethodRemove(
                CustomerSessionCreateParams.Components.PaymentElement.Features.PaymentMethodRemove
                    .ENABLED);

    CustomerSessionCreateParams.Components.PaymentElement.Builder paymentElementBuilder =
        CustomerSessionCreateParams.Components.PaymentElement.builder()
            .setEnabled(true)
            .setFeatures(featuresBuilder.build());

    CustomerSessionCreateParams.Components.Builder componentsBuilder =
        CustomerSessionCreateParams.Components.builder()
            .setPaymentElement(paymentElementBuilder.build());

    builder.setComponents(componentsBuilder.build());

    CustomerSessionCreateParams params = builder.build();

...```
brisk flame
#

Ok I get it

glad herald
#

Overall though this probably is too much effort for the wording change. I think basically each time the checkbox is checked or unchecked you would need to update your elements instance to either set or unset setupFutureUsage.
https://docs.stripe.com/js/elements_object/update#elements_update-options-setupFutureUsage
Also I just filed the feedback around this. Unfortunately I can't promise if or when we can make the wording change on our side but that would be a relatively small change.

brisk flame
#

Yes, this is a lot of work (with backend impact too). Thank you for your help. Any chance I get updated if this becomes a feature?

vapid ingotBOT
#

Hello @brisk flame, we have sent you a direct message, please check it at https://discord.com/channels/@me/1392157858954612756

  • 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
glad herald
#

Let me know when you've opened a ticket through the above process, we may be able to help you follow that through there

brisk flame
#

done

glad herald
#

Thank you, will follow up with a quick email through there shortly

brisk flame
#

thanks for your help