#om_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/1374457189359419392
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! just want to let you know that i'm working on some other threads atm but we'll look at this soon
Hello
Taking over here
You can set terms to never when you create the Payment Element - https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-terms
However, I'd recommend checking with your lawyer about compliance as many countries require that you let the user know that you're storing their payment method
let options = {
appearance,
layout: {
type: 'accordion',
defaultCollapsed: false,
radios: true,
spacedAccordionItems: false,
layout: 'accordion'
},
terms: 'never',
customerSessionClientSecret: customerClientSecret,
paymentMethodOrder: PI_PAYMENT_METHODS_ORDER
}
I have passed like this but getting error
Invalid value for elements.create('payment'): terms should be an object. You specified: never.
I believe you're passing it to the wrong options
The options you've shared are for creating Element object
terms is configurable on PaymentElement object
do we do it with ruby or only js ?
<PaymentElement
options={options}
onChange={handlePaymentElementChange}
onReady={() => {
setUnloaded(true)
setTimeout(() => {
props.setLoader(false)
}, 1000)
}}
/>
I am using PaymentElement component
try setting following then
terms: {
card: 'never'
}
I have already done that in options that I am passing to <PaymentElement
If you have done that then you shouldn't be seeing Invalid value for elements.create('payment'): terms should be an object. You specified: never. error
I'd suggest double checking your options object
now that error is gone but I am still able to see that checkbox
Can you share a screenshot of your UI that's being rendered?
Oh let me check something
sure
Ah this is because you're using the CustomerSessionClientSecret with the Elements - https://docs.stripe.com/payments/save-customer-payment-methods#collect-consent-to-reuse-a-payment-method-outside-of-the-payment-element
I don't believe there's a way to hide that checkbox
so like in ths document given I have passed allow_redisplay: "always" for confirmPayment but issue still exist
I don't understand what you mean by that. That parameter is not really dependent of the checkbox. Rather it allows you to override the checkbox.
ohh so is there any way we can hide the check box with the options
const options = {
appearance,
layout: {
type: 'accordion',
defaultCollapsed: false,
radios: true,
spacedAccordionItems: false
},
// Hide legal agreements text for credit card
// Refer https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-terms
terms: { card: 'never' },
paymentMethodOrder: PAYMENT_METHODS_ORDER,
clientSecret: clientSecret
}
I don't believe there's a way to hide the checkbox but let me check with a colleague
yes please let me know
Ah can you try setting payment_method_save parameter when you create Customer Session? https://docs.stripe.com/api/customer_sessions/create?api-version=2024-09-30.acacia#create_customer_session-components-payment_element-features-payment_method_save
you'd want to set it to disabled