Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在ApplePay/Swift中使用pkpaymentsummaryitemtype.pending?_Ios_Swift_Applepay - Fatal编程技术网

Ios 如何在ApplePay/Swift中使用pkpaymentsummaryitemtype.pending?

Ios 如何在ApplePay/Swift中使用pkpaymentsummaryitemtype.pending?,ios,swift,applepay,Ios,Swift,Applepay,在我的应用程序中,我需要添加待定付款(在用户获得某些服务后)。 我正在实施苹果支付并收到代币。但是我不知道如何使用项目类型pkpaymentsummaryitemtype.pending付款 以下是我的支付方式: func makePay() { let request = PKPaymentRequest() request.merchantIdentifier = ApplePaySwagMerchantID

在我的应用程序中,我需要添加待定付款(在用户获得某些服务后)。 我正在实施苹果支付并收到代币。但是我不知道如何使用项目类型pkpaymentsummaryitemtype.pending付款

以下是我的支付方式:

func makePay()
    {
        
        let request = PKPaymentRequest()
        
        request.merchantIdentifier = ApplePaySwagMerchantID
        request.supportedNetworks = SupportedPaymentNetworks
        request.merchantCapabilities = PKMerchantCapability.capability3DS
        
        
        request.countryCode = "US"
        request.currencyCode = "USD"
        
        
        request.paymentSummaryItems = [
            PKPaymentSummaryItem(label: "Some service", amount: 0, type: PKPaymentSummaryItemType.pending)]
        
        let applePayController = PKPaymentAuthorizationViewController(paymentRequest: request)!
        applePayController.delegate = self
        
        var topVC = UIApplication.shared.keyWindow?.rootViewController
        while((topVC!.presentedViewController) != nil) {
             topVC = topVC!.presentedViewController
        }
        topVC?.present(applePayController, animated: true)
       
    }
但当我必须出示并借记最终金额时?我在swift/IOS上找不到代码示例

或者,如果我理解正确-使用该类型我刚收到授权,而不是使用收到的代币,我的银行/支付系统将在我发送后借记最终金额

对吗