#james-voracio-commerce_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/1329105103382253700
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you give an example?
Hi
Yes, we are having this issue on a live site, I'm testing with my own phone, with my own ApplePay.
Can you tell me, should we be able to fetch back the full postcode from the address held within ApplePay?
In regard to your question, as I'm testing ApplePay Express checkout here, the website isn't sending address information to ApplePay, we (the ecommerce platform) fetch the address from ApplePay. I recall that we can only get the FULL address record back after the payment has been successful, we do that and pull those details back into the customer record. The problem is that we need the full post code earlier, as the post code determines what delivery options there are (which we send to Apple Pay)
we (the ecommerce platform) fetch the address from ApplePay.
How are you doing this specifically?
Can you share the code?
My lead developer is just taking a look, we have followed the stripe docs for this integration, I'll sending you somthing shortly ...
ok...
Stripe: ShippingAddressChange_Ajax
expressCheckoutElement.on('shippingaddresschange', function (e) {
var intId = setInterval(() => {
if (!modal.state.initiated)
console.log('waiting address');
else {
clearInterval(intId);
shippingAddressChangeHandle(e);
}
}, 100);
});
function shippingAddressChangeHandle(e) {
console.log('Stripe shippingaddresschange event');
console.log(e);
var payload = {
twoLetterCountryCode: e.address.country,
postCode: e.address.postal_code
};
};
FYI I've just found this on Stack Overflow, sounds very similar to the issue we are having... https://stackoverflow.com/questions/57775999/apple-pay-how-can-i-get-shippingaddress-before-show-the-order-information
That may be unrelated though...
For example, my postcode, the one thats in my ApplePay shipping, is HD8 8AP
But the code we use seems to only pull back the first part of the poscode, so we only get HD8
its possible Stripe are using this, noting it says 'For Canada and United Kingdom, a redacted shipping address excludes the last three characters of the postal code.'
Is there any other way that we can receive a non redacted shipping address (or at least full postcode) ?
I really can't see how Express checkout can work properly for endless sites using ApplePay, it seems like a major limitation for delivery calculations
ah this is probably the issue
are you in one of those countries?
Yes we are UK
I just used ChatGPT and it says "This is a common challenge when using Apple Pay with Stripe, as Apple Pay prioritizes privacy and sends limited address details during the checkout process. "
The problem is, we don't know the full amount to charge the customer, until we know their full postcode, so that we can calculate the delivery cost.
So the info I found said this is a restriction on Apple's end and it's intentional because they don't want to reveal a home address to a website without a user's explicit consent. So, they only share the minimum needed info to calculate shipping cost. I don't know anything about UK postal codes, but the info I have indicates that the first part of the postal code should be sufficient
There isn't a way around this
This is a hard restriction by Apple
Ok yeh thats pretty much what we've found too, it essentially means there's no way with Express Checkout (AP) to accurately find and draw the delivery methods, to ensure the correct total price
You should be able to calculate shipping with the first part of the postal code according to what I found
It just won't give you the exact area code
But if your shipping varies depending on that then I guess that makes sense
That all depends on how the shipping rules are configured on the website, for example HD8 1AP might be lower cost than HD8 9AP
Yeh we allow very granular calculation of shipping, but seems its too advanced for ApplePay to handle due to their OTT privacy enforcement
Yeah unfortunately that seems to be the case
Ok thats foir discussing, we'll look at some form of a workaround
Do you happen to know if there are any known issues with ApplePay at the moment? IE do Stripe have access to a system status for them?
No. Are you facing a specific issue?
Ok, yeh its something strange, from our lgs it seems rare, but now I can replicate myself. Again its with express checkout, when AP initiates, all looks good, but the busy icon spins and after 10 seconds says to update the address
We can't see anything obvious within the browser console logs, the address within the ApplePay account is full and complete, we got the postcode back (limited) as HD8 and fed back the correct data for the delivery cost
Can you share a screen recording? Not sure exactly what you mean