#remilapierre_api
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/1418608822192439338
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there! Can you share details of how you generated that page? If you're using Stripe elements, it is possible to hide the terms so you can replace them with your own:
https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-terms
<PaymentElement options={{
business: {name: this.props.org.name},
defaultValues: {
billingDetails: {
name: this.props.client.name,
email: this.props.client.email,
phone: this.props.client.phone,
address: {
line1: this.props.client.address,
city: this.props.client.city,
state: this.props.client.state,
postal_code: this.props.client.postal,
}
}
},
}} />
I can add it here I guess?
Yes that looks like the right part of the code
You should be able to configure it with the fields.billingDetails.address.postalCode parameter:
https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address-postalCode
<PaymentElement options={{
business: {name: this.props.org.name},
defaultValues: {
billingDetails: {
name: this.props.client.name,
email: this.props.client.email,
phone: this.props.client.phone,
address: {
line1: this.props.client.address,
city: this.props.client.city,
state: this.props.client.state,
postal_code: this.props.client.postal,
}
}
},
terms: {
card: 'never',
applePay: 'never',
googlePay: 'never'
},
fields: {
billingDetails: {
address: 'never'
}
}
}} />
So this will work
Looks right at a glance, give it a try and let me know if there are any issues!
Wait sorry, if you just want to configure the postal code then you're missing that parameter
fields: {
billingDetails: {
address: {
postalCode: 'never'
}
}
}
Uncaught (in promise) IntegrationError: You specified "never" for fields.billing_details.address.postal_code when creating the payment Element, but did not pass confirmParams.payment_method_data.billing_details.address.postal_code when calling stripe.confirmPayment(). If you opt out of collecting data via the payment Element using the fields option, the data must be passed in when calling stripe.confirmPayment().
getting this
The error message is saying that you need to pass the data one way or another. Can you explain the specific reason why you want to hide the zip code field in the element?
Yes, it is necessary in this case