I have a flow in my app where the user enters an address they wish to ship to during checkout but before the Apple Pay prompt. That address may be the same as on their card, it may be different. However, when the Apple Pay prompt comes up, the shipping address is that default one attached to their card rather than the one I provide before I call authorize():
let checkout = PayCheckout(
id: checkoutId.rawValue,
lineItems: lineItems,
giftCards: nil,
discount: nil,
shippingDiscount: nil,
shippingAddress: self.shippingAddress, // this provided value is from what the user input in the form
shippingRate: nil,
currencyCode: "USD",
subtotalPrice: subtotal,
needsShipping: true,
totalTax: tax,
paymentDue: subtotal + tax
)
ShopifyClient.shared.getShopName { shopName in
guard let shopName = shopName else {
self.showErrorForCheckout("Unable to complete checkout. Please try again.")
self.isCheckingOut = false
return
}
let paySession = PaySession(
shopName: shopName,
checkout: checkout,
currency: PayCurrency.USD,
merchantID: "merchant.myshopName"
)
paySession.delegate = self
self.paySession = paySession
paySession.authorize()
}
The shippingAddress provided into the object here is what the user entered in the form.
How can I change the shipping address value that shows when Apple Pay pops up? Thanks