#matrixx333_docs
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/1428821658873102388
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
I don't really understand the ask. You should never have to do this:
Conditionally setting the SetupFutureUsage property on the create payment intent object on the back end if the checkbox from the PaymentMethodSave configuration is enabled
That checkbox itself toggles setup_future_usage behavior. You don't need to set it on the backend if you want to employ the use of that checkbox
Hi codename_duchess, thank you for your help! The goal is to allow the payment element to display the text By providing your card information, you allow {company} to charge your card... when creating a new card payment method during checkout, while also retaining the functionality of the Save payment details for future purchases checkbox.
As I am understanding the documenation, by setting setup_future_usage on the front end, it overrides the Save payment details for future purchases checkbox. Is there a way to have both? Basically use setup_future_usage to enable the By providing your card information, you allow... text while also allowing the customer to conditionally save the payment method to Stripe?
That text should show afaik when the customer toggles the checkbox on
let me test that real quick.....I will remove the setup_future_usage from the payment element options and perform a checkbox test
I've attached a video of the behavior...my options object looks like the following
const options = {
customerSessionClientSecret: customerClientSecret,
mode: 'payment',
currency: 'usd',
amount: originalValues?.amount * 100,
paymentMethodCreation: 'manual',
appearance: {
theme: 'stripe',
variables: {
colorPrimary: '#0570de',
colorBackground: '#ffffff',
colorText: '#30313d',
colorDanger: '#df1b41',
fontFamily: 'Ideal Sans, system-ui, sans-serif',
spacingUnit: '2px',
borderRadius: '4px'
}
},
// this setting disables manual entry of ACH account details
paymentMethodOptions: {
us_bank_account: {
verification_method: 'instant'
}
}
}
And I am using the following to setup my customer session:
var paymentElementFeatures = new CustomerSessionComponentsPaymentElementFeaturesOptions
{
PaymentMethodRedisplay = "enabled",
PaymentMethodRemove = "disabled",
PaymentMethodSave = "enabled",
PaymentMethodSaveUsage = "off_session",
PaymentMethodAllowRedisplayFilters = ["always", "limited", "unspecified"],
PaymentMethodRedisplayLimit = 10
};
apologies for the horrible formatting
when I add setup_future_usage to the options, I see the text I'm looking for
Ah ok perhaps I'm mistaken then
I guess that kind of makes sense because the box itself warns that you are saving payment method details for future purchase
Whereas if you didn't have the checkbox there but passed setup_future_usage, then you'd need to explicitly warn the customer
that did it! I'm going to validate that the checkbox still works as expected but this is exatly what I was looking for! You're team is great! thank you so much!
Sweet happy to help