【发布时间】:2019-10-08 18:11:03
【问题描述】:
我的应用中有一个流程,用户在结账期间但在 Apple Pay 提示之前输入他们希望运送到的地址。该地址可能与他们卡上的地址相同,也可能不同。但是,当 Apple Pay 提示出现时,送货地址是他们卡上的默认地址,而不是我在致电 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()
}
这里提供给对象的shippingAddress是用户在表单中输入的内容。
如何更改 Apple Pay 弹出时显示的送货地址值?谢谢
【问题讨论】: