#arti-villa_error
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/1328715326334046313
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! can you share the exact code you're using?
The rest has been removed since it works fine. When I comment in some of these options it throws.
<AddressElement
options={{
mode: 'shipping',
// allowedCountries: allowedCountriesShipping,
allowedCountries: ['US', 'CA', 'GB'],
// blockPoBox: false,
// fields: {
// phone: 'always',
// },
// validation: {
// phone: {
// required: 'always',
// },
// },
}}
/>
using these versions. in addition this is the loadStripe section
"@stripe/react-stripe-js": "^3.0.0",
"@stripe/stripe-js": "^5.2.0",
const stripe = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!, {
betas: ['custom_checkout_beta_5'],
});
Is there a sample repo using all fields like address, shipping, payment etc you provide online I can mirror?
no. Hmm, that feels corect like it should work, not sure why it's not. Do you happen to have a link to a public page where this happening so I can have a look?
I don't. maybe I can create a dev repo or a sandbox and share a smaller isolated snippet.
let me work on that
your code works fine for me
where exactly do you see the error, it is an actual console/runtime error or a TS warning
I guess when you're using that Custom Checkout beta the options that the AddressElement can support are different : https://docs.stripe.com/payments/collect-addresses?payment-ui=embedded-components&client=react#shipping-address-element
you'd specify it on the backend via https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-shipping_address_collection-allowed_countries instead.
got it. this is a bit confusing so many variations. so i need to specify shipping/billing, payments, tax, discounts etc. all this is done via be options then? how do i prefill an existing customer who's already paid on my site or via link?
I mean its in beta so it makes sense. if I want to limit the customer payment types to bank or crypto can that be if > $x, can I configure this via payment methods on session creation?
the idea of this product is you use the CheckoutSession to manage the cart and overall checkout process but can use the Elements UIs to more closely integrate into your existing layouts; so most of the configuration is done on the CheckoutSession object.
how do i prefill an existing customer who's already paid on my site or via link?
not sure, let me look.
. if I want to limit the customer payment types to bank or crypto can that be if > $x, can I configure this via payment methods on session creation?
see https://docs.stripe.com/payments/payment-method-rules
got it/ will try to take a stab at this tomorrow am.