Stripe Apple Pay 不会出现在主 iCloud 账户上

Stripe Apple Pay won't show up on main iCloud account with live card

所以我的目标是让 Apple Pay sheet 在我点击应用程序中的 Apple Pay 按钮时显示。所以我经历了 documentation regarding integrating Apple Pay with the Stripe API 并一步步跟进,甚至是故障排除问题,创建了一个新的商家 ID 和所有爵士乐,它出现在我在 App Store Connect 中创建的沙盒测试 iCloud 帐户上。

现在我了解到您无法将 Stripe 测试卡保存到 iOS 中的电子钱包应用程序中,这太糟糕了,根据我的经验,我假设您不能同时使用 Apple 沙盒测试卡使用与 Stripe 集成的 Apple Pay。我对此可能是错误的,但每次我尝试使用 Apple 提供的沙盒测试卡使用 Apple Pay 付款时,它总是显示 'Payment Not Completed'。我还看到你可以使用 live 卡而不被收费所以我登录了我的主 iCloud,将我的借记卡添加到钱包,但是当我在我的 phone 上模拟应用程序并点击 Apple Pay 按钮时,它不显示 Apple Pay sheet,我使用完全相同的代码,它适用于我的沙盒帐户,所以我相信代码没有问题。

这是两种方式的代码块:

 @objc func applePayTapped() {
    let text = actualCostOfEvent.text
    let textWithout$ = text?.replacingOccurrences(of: "$", with: "")
    let finalCost = Double(textWithout$ ?? "")
    let fee = Double(0.50) * Double(stepperValue.value)
    let total = finalCost! + fee
    
    let paymentRequest = StripeAPI.paymentRequest(withMerchantIdentifier: "merchant.xxxxx.xxxxx.xxxxx", country: "CA", currency: "CAD")
    
    paymentRequest.paymentSummaryItems = [
        PKPaymentSummaryItem(label: navigationItem.title ?? "" , amount: NSDecimalNumber(value: finalCost!)),
        PKPaymentSummaryItem(label: "Service Fee", amount: NSDecimalNumber(value: fee)),
        PKPaymentSummaryItem(label: "Company", amount: NSDecimalNumber(value: total))
    ]

    if let applePayController = STPApplePayContext(paymentRequest: paymentRequest, delegate: self) {
        if StripeAPI.canSubmitPaymentRequest(paymentRequest) {
            applePayController.presentApplePay()
            startCheckout()
        }
    } else {
        print("There was an issue presenting the Apple Pay VC")

    }
}

在撰写本文时,我已经联系了 Stripe 支持人员,但与此同时,您对我目前可以做什么有什么建议吗?

为了使其正常工作,我需要将 .interac 添加到 Apple Pay 支持的网络。

StripeAPI.additionalEnabledApplePayNetworks = [.interac]

Apple Pay sheet 现在显示正常。