将ApplePay与我的测试应用程序集成时,我收到错误:
此设备无法付款
我已经设置了一张卡片,并在销售点终端进行了测试 - 在那里工作得很好.
应该工作(但没有)的代码行是:
PKPaymentAuthorizationViewController *auth = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest];
Run Code Online (Sandbox Code Playgroud) 我们如何在iphone中将十进制数舍入为2位?
例如 ,
5345 - > 53
570 - > 57
89523 - > 90
我尝试使用nsformatter,这是我使用的代码,
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
[formatter setMaximumIntegerDigits:2];
[formatter setRoundingMode: NSNumberFormatterRoundUp];
NSString *numberString = [formatter stringFromNumber:[NSNumber numberWithInt:570]];
[formatter release];
NSLog(@"%@",numberstring);
Run Code Online (Sandbox Code Playgroud)
即使将舍入模式更改为不同的选项后,我仍然将值设置为70.请在这件事上给予我帮助
谢谢,维诺德.
在尝试将Apple Pay集成到我的测试应用程序中时,即使我按照Apple Apple Pay入门文档中的所有说明操作,我也无法显示付款单.
在发出付款请求时:
PKPaymentAuthorizationViewController *auth = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest];
我得到两个奇怪的错误,网络搜索没有结果:
PKInAppPaymentService连接出错:错误Domain = NSCocoaErrorDomain Code = 4097"操作无法完成.(Cocoa error 4097.)"(连接到名为com.apple.passd.in-app-payment的服务)UserInfo = 0x174273780 {NSDebugDescription =连接到名为com.apple.passd.in-app-payment的服务}
与远程警报视图服务的连接失败