Stripe和Apple Pay在iOS App中不起作用 [英] Stripe and Apple Pay not working in iOS App

查看:187
本文介绍了Stripe和Apple Pay在iOS App中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我花了很长时间解决这个问题,所以我感到非常沮丧.我正在使用以下代码创建请求:

I am getting very frustrated as I have spent long hours on a solution to this problem. I am creating a request using the code below:

 PKPaymentRequest *request = [Stripe
                             paymentRequestWithMerchantIdentifier:merchantId];
// Configure your request here.
NSString *label = @"Product 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视图开始,并带有指纹;但是,当确认指纹后,它会旋转一圈,然后弹出警报并显示:

When the code runs, it starts off fine as the Apple Pay view pops up with the finger print, however, when the finger print is confirmed, it spirals around for a bit and then pops up with an alert and says:

"Apple Pay在"AppName"中不可用"

'Apple Pay is Not Available in "AppName"'

检查此应用程序的设置,并确保其设计为使用Apple Pay.

Check the settings for this app and make sure it was designed to use Apple Pay.

任何想法都将不胜感激.

Any thoughts would be greatly appreciated.

推荐答案

2015年5月-也遇到了此问题.

May 2015 - Also encountered this problem.

由于我的配置文件和其他未正确设置的内容出现问题,我必须为我的应用程序重做所有证书.

I had to redo all the certificates for my app due, because I had an issue with the provisioning profile and other stuff that were not set up correctly.

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

Apple pay WAS working before all the changes...still worked after I changed all the certificates, but....day later it stopped working!!!

这就是我所做的.

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

I check the Apple Pay settings in the phone, re-added my billing address (sometimes this could be the problem, but it wasn't).

我在应用程序中检查了权利证书,以确保已正确设置.在这里,请确保您已经包括了您的商家ID ...应该从Merchant.com.nameOfApp开始(您可以从Apple Center的商家ID中获取它.(这很好-没问题)

I check the entitlements certificate in the app, to make sure that it was properly setup. Here make sure you have your merchant id included...should start with merchant.com.nameOfApp (you can get this from apple center under merchant id. (This was good - not the problem)

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

Checked all my certificates - everything seem to be correct.

我做的最后一件事是重新生成苹果薪水证明.繁荣!这就是问题所在.不知道为什么,它只是起作用.从您的计算机上删除条纹和Apple Apple Pay的旧证书,然后按照Stripe/Apple Pay文档中的说明进行操作.

The last thing I did was to regenerate the certificate for apple pay. BOOM! That was the issue. Not sure why, it just worked. Delete the old certificates for stripe and apple apple pay from your computer and follow the instructions in the stripe/apple pay documentation.

在这里看到

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

希望获得帮助!

这篇关于Stripe和Apple Pay在iOS App中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆