调试 Apple pay message 支付请求无效:<private>
Posted
技术标签:
【中文标题】调试 Apple pay message 支付请求无效:<private>【英文标题】:Debug Apple pay message Payment request is invalid: <private> 【发布时间】:2016-10-13 09:45:30 【问题描述】:我的应用程序实现了 Apple Pay,并且成功显示了某些卡(如 boon 虚拟卡)的支付表。使用我的个人信用卡(法国信用卡),付款请求无效。
我的代码:
let paymentRequest = PKPaymentRequest()
paymentRequest.merchantIdentifier = "merchant.com.<companyName>"
paymentRequest.requiredBillingAddressFields = [.name]
if #available(ios 10.0, *)
paymentRequest.supportedNetworks = PKPaymentRequest.availableNetworks()
else
paymentRequest.supportedNetworks = [.masterCard, .visa, .amex]
paymentRequest.countryCode = "FR"
paymentRequest.currencyCode = "EUR"
paymentRequest.paymentSummaryItems = booking.charges.flatMap
PKPaymentSummaryItem(label: $0.label, amount: $0.amount, type: .pending)
+ [PKPaymentSummaryItem(label: LanguageManager.get(key: "__app_name"), amount: booking.total.amount, type: .pending)]
if let paymentAuthorizationViewController = PKPaymentAuthorizationViewController(paymentRequest: paymentRequest) as PKPaymentAuthorizationViewController?
paymentAuthorizationViewController.delegate = self
self.present(paymentAuthorizationViewController, animated: true, completion: nil)
paymentAuthorizationViewController
是nil
,我有一个控制台日志Payment request is invalid: <private>
我如何调试它并知道这个神秘的 <private>
背后是什么?
【问题讨论】:
【参考方案1】:您尝试收取的总金额是否为 0?看起来是这样,但我不确定。您不能有零金额的付款请求,它至少需要大于零。您仍然可以将汇总项标记为待处理,并且不会向用户显示金额。
【讨论】:
以上是关于调试 Apple pay message 支付请求无效:<private>的主要内容,如果未能解决你的问题,请参考以下文章