#slendie_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/1367937934732558396
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, we document here that Autocomplete is supported in these countries: https://docs.stripe.com/elements/address-element#autocomplete
Yes, I'm using a supported country
Was that request ID helpful? If not I'm happy to find another one
That is not a Stripe owned request id. Stripe request ids would look something like req_
Can you share the entire Address Element creation code with me?
Yes
<AddressElement
options={{
mode: 'shipping',
blockPoBox: true,
fields: {
phone: 'always',
},
validation: {
phone: {
required: 'always',
},
},
display: {
name: 'split',
},
autocomplete: {
mode: 'google_maps_api',
apiKey: 'AIzaSyCQnlisVwSQiGo1-8XA4wadUS_I_4ZAoo8',
},
}}
onChange={event => {
console.log('event', event);
const address = {
firstName: event.value.firstName,
lastName: event.value.lastName,
line1: event.value.address.line1,
line2: event.value.address.line2,
city: event.value.address.city,
state: event.value.address.state,
zipCode: event.value.address.postal_code,
country: event.value.address.country,
phoneNumber: event.value.phone,
};
dispatch(stripeUpdateAddressForm({ address }));
// onChange(address);
setIsAddressValid(event.complete);
}}
className={classNames(styles.addressElement, {
[styles.mobileAddressElement]: isMobile,
})}
/>
And I'll try to find a good request ID too, one sec
Yeah, it looks like https://docs.stripe.com/js/elements_object/create_address_element#address_element_create-options-autocomplete-apiKey that would work.
Yeah, it's strange
Can you share your URLso I can try to replicate this on my end?
Sadly no, I'm doing this locally
What about a request ID?
The one I shared is definitely stripe btw, it's from hitting the https://js.stripe.com/v3/elements-inner-address-ced0ff7052df39c1f750544122ec9579.html endpoint
I'm trying to see what an example payment would be to see if I can debug it on my end
Without a URL, this would be harder to debug
You can ignore that last comment about local, I was wrong ๐
Anyway...is there a request ID I can provide?
Since it's happening on the client side I'm thinking the URL will be helpful. If it's not local can you share the public link so I can attempt to reproduce this on my end?
It is local
There's no URL I can give you to test this. But I can look at the network calls and find request IDs
I see we're making this call successfulyl from the client
https://maps.googleapis.com/maps/api/js?key=AIzaSyCQnlisVwSQiGo1-8XA4wadUS_I_4ZAoo8&libraries=places&callback=noop
Ah wait, I'm seeing this error from Google
"Google Maps JavaScript API error: ApiTargetBlockedMapError\nhttps://developers.google.com/maps/documentation/javascript/error-messages#api-target-blocked-map-error"
Ok so yeah it looks like there's an issue with my api key configuration
One other question - it's not working when I try this either, can you tell me why?
autocomplete: {
mode: 'automatic',
},
Ah, api key config. will cause an issue
Yeah, that's on my end
But can you help me figure out why automatic isn't working?
Is it because I don't also have a PaymentElement on the page?
You need to use PaymentElement with the Address Element: https://docs.stripe.com/elements/address-element#autocomplete
You're exactly right!
Darn, ok. Is there any wya around that?
I'm using PaymentElement, but not in the same Element provider
There is not, if you use the Address Element by itself you need to pass the API key fron google maps
Ok no worries, thanks
I got it working via my Google Api key, so all good ๐
Thanks for the help!
Great to hear!
Oh one more thing
If we do use the automatic autocomplete, do we have to pay for the Google API usage?
Or is that included in our stripe contract
That is not something I would know. With anything related to fees, our support team will be able to assist you better than I can: https://support.stripe.com/contact
OK no problem, thanks again
Sure