Currently working on integrating Apple Pay WEB using JS and Braintree as the payment provider. In order to calculate US sales tax for the order, I need to gather certain information.
The user initiates the payment process by clicking on the "Pay with Apple Pay" button, which brings up the Apple Pay payment sheet requiring a shipping address including postal address, zip code, name, and email.
However, when calling the session.onshippingcontactselected function, I am only able to retrieve limited information such as locality, administrative area, postal code, country, and countryCode from the shipping contact. This means I cannot access addressLines which contain the street name and number necessary for accurate tax calculation.
Apple's documentation states that they provide the full address only after the user authorizes the payment, which is too late in my case since I need the tax amount prior to placing the order or the user making the payment.
Seeking a workaround for this issue. Any suggestions?