#taraxe_code
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/1392146344344551436
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello, looking into whether this is customizable. Can you tell me more about what you are trying to customize the text to?
the highlighted text on this screenshot, to an arbitrary text value (default value comes from Stripe I guess)
Gotcha, and what would you like it to say instead?
"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
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.
It's not regulatory, it just sounds inappropriate in healthcare to talk about purchase
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.
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,
},
},
};```
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
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();
...```
This is the property for showing previously saved PMs
https://docs.stripe.com/api/customer_sessions/create?api-version=2024-09-30.acacia#create_customer_session-components-payment_element-features-payment_method_redisplay
And this is the property for showing the checkbox to save new PMs
https://docs.stripe.com/api/customer_sessions/create?api-version=2024-09-30.acacia#create_customer_session-components-payment_element-features-payment_method_save
Ok I get it
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.
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?
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.
Let me know when you've opened a ticket through the above process, we may be able to help you follow that through there
done
Thank you, will follow up with a quick email through there shortly
thanks for your help