PKPaymentAuthorizationController委托未调用

时间:2019-02-21 14:15:16

标签: ios

我有NSObject类,需要显示苹果工资。因此,我使用的是PKPaymentAuthorizationController而不是PKPaymentAuthorizationViewController。 显示Apple工资单,但未调用委托方法。我应该如何设置委托给我的控制器。我的iOS版本高于11 这是我的代码。

if([[PKPaymentAuthorizationController canMakePaymentsUsingNetworks:@ [PKPaymentNetworkVisa,PKPaymentNetworkMasterCard,PKPaymentNetworkAmex]]){ NSLog(@“可以用苹果付款”);

    PKPaymentRequest *paymentRequest = [self paymentRequest:@"10"];
    paymentContr = [[PKPaymentAuthorizationController alloc] initWithPaymentRequest:paymentRequest];

    paymentContr.delegate = self; // here self is MyClass: NSObject

    [paymentContr presentWithCompletion:^(BOOL success) {

        NSLog(@"present");
    }];

}

0 个答案:

没有答案