OGeek|极客世界-中国程序员成长平台

标题: ios - Stripe 和 Apple Pay 在 iOS 应用程序中不起作用 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 15:03
标题: ios - Stripe 和 Apple Pay 在 iOS 应用程序中不起作用

我非常沮丧,因为我花了很长时间来解决这个问题。我正在使用以下代码创建一个请求:

 PKPaymentRequest *request = [Stripe
                             paymentRequestWithMerchantIdentifier:merchantId];
// Configure your request here.
NSString *label = @"roduct Description";

NSDecimalNumber *amount = [NSDecimalNumber decimalNumberWithString:[productpriceDouble stringByReplacingOccurrencesOfString"$" withString""]];
request.paymentSummaryItems = @[
                                [PKPaymentSummaryItem summaryItemWithLabel:label
                                                                    amount:amount]
                                ];
request.merchantIdentifier = @"merchantId";
request.countryCode = @"US";
request.currencyCode = @"USD";
request.merchantCapabilities = PKMerchantCapability3DS;

    PKPaymentAuthorizationViewController *paymentController;


    paymentController = [[PKPaymentAuthorizationViewController alloc]
                         initWithPaymentRequest:request];
    paymentController.delegate = self;

    [self presentViewController:paymentController animated:YES completion:nil];

当代码运行时,它开始正常,因为 Apple Pay View 弹出指纹,但是,当指纹被确认时,它会盘旋一会儿,然后弹出一个警报并说:

'Apple Pay 在“AppName”中不可用'

检查此应用的设置并确保其设计为使用 Apple Pay。

任何想法将不胜感激。



Best Answer-推荐答案


2015 年 5 月 - 也遇到了这个问题。

我不得不为我的应用重做所有证书到期,因为我的配置文件和其他设置不正确的东西有问题。

Apple pay 在所有更改之前都在工作...在我更改所有证书后仍然有效,但是....一天后它停止工作了!!!

这就是我所做的。

我检查了手机中的 Apple Pay 设置,重新添加了我的帐单地址(有时这可能是问题所在,但不是)。

我检查了应用程序中的权利证书,以确保它已正确设置。在这里确保您包含您的商家 ID...应该以 Mercer.com.nameOfApp 开头(您可以从 Apple Center 下的商家 ID 获取此信息。(这很好 - 不是问题)

检查了我所有的证书 - 一切似乎都是正确的。

我做的最后一件事是为 Apple Pay 重新生成证书。繁荣!这就是问题所在。不知道为什么,它只是工作。从您的计算机中删除 stripe 和 apple apple pay 的旧证书,然后按照 stripe/apple pay 文档中的说明进行操作。

看这里

https://stripe.com/docs/mobile/apple-pay

希望对您有所帮助!

关于ios - Stripe 和 Apple Pay 在 iOS 应用程序中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29618296/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4