Stripe ApplePayContext无法在iOS 14上显示付款表

问题描述

我正在尝试通过Stripe和PassKit实施Apple Pay付款。我已完成以下操作来创建STPAppleyPayContext,并使用其presentApplePay(on:completion:)方法显示Apple Pay付款表。

let merchantId = "A_VALID_MERCHANT_ID_HERE"
let currency = "usd"
let country = "US"
let paymentReq = Stripe.paymentRequest(withMerchantIdentifier: merchantId,country: country,currency: currency)

// Configure the line items on the payment request
let charge = NSDecimalNumber(value: 1000)
let summaryItems = [PKPaymentSummaryItem(label: "Service",amount: charge)]
paymentReq.paymentSummaryItems = summaryItems

if let applePayContext = STPApplePayContext(paymentRequest: paymentReq,delegate: self) {
    print("--- presenting apple pay sheet")
    applePayContext.presentApplePay(on: self,completion: nil)
} else {
    print("--- Failed to create STPApplePayContext,may be a problem with the Apple Pay config")
}

在日志中,打印了"--- presenting apple pay sheet",因此我相信成功调用applePayContext.presentApplePay(on:completion:)。但是,没有提供任何工作表,并且我找不到任何错误日志。

完全相同的代码在我们在iOS 13上构建应用程序时起作用,但在iOS 14上却不起作用。我想知道它是否与iOS中的Apple Pay系统的某些更新有关14,否则其他地方出了问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)