小编Jos*_*fni的帖子

使用Apple Pay无需付款即可创建令牌

我有两个问题:

  1. 有没有办法在没有付款的情况下使用Apple Pay创建STPToken?在我的iOS应用程序中,客户输入他们的付款信息或决定在注册时使用Apple Pay.当客户决定进行购买(在注册后的某个时间),他们的卡将自动收费.我可以调用一种方法来检查是否可以进行付款请求,但似乎我必须实际运行付款并对卡进行充值才能获得令牌.请注意,如果客户手动输入付款信息,我可以创建客户并保存卡而无需向客户收费.只有在客户决定使用Apple Pay时才会出现此问题.

  2. 出于测试目的,当我在注册过程中使用付款创建令牌并向客户的卡收费时,我注意到dynamic_last4和到期日期字段与实际卡不匹配.我不仅在我的程序中验证了这一点,而且在我登录Stripe的网站并检查客户的记录时也验证了这一点.虽然这些字段与实际卡不匹配,但我确实可以正确地为卡充电.这些字段是否会被Stripe或Apple以某种方式掩盖?

ios stripe-payments stripe.net applepay

7
推荐指数
1
解决办法
1324
查看次数

适用于iOS 8和iOS 9的自定义Unwind Segue

我的问题是,如何让以下自定义展开segue在iOS 9之前的版本以及运行iOS 9的设备上运行?

我有一个自定义Segue显示一个视图控制器,然后有一个相应的自定义展开Segue.此代码在iOS 8中运行良好,并通过创建UIStoryboardSegue的子类并实现该perform方法来实现.然后我在自定义导航控制器中覆盖以下方法:

- (UIStoryboardSegue *) segueForUnwindingToViewController:    (UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier
{
    UIStoryboardSegue *segue;
    if([fromViewController isKindOfClass:[MyViewController class]]){
        segue = [[CustomSegue alloc] initWithIdentifier:identifier source:fromViewController destination:toViewController]; //Custom Unwind Segue
    }
    else{
        UIStoryboardSegue *unwindSegue = [super segueForUnwindingToViewController:toViewController fromViewController:fromViewController identifier:identifier]; //Normal Unwind Segue
        segue = unwindSegue;
    }
    return segue;
}
Run Code Online (Sandbox Code Playgroud)

在iOS 9中,segueForUnwindingToViewController已弃用.它仍适用于MyViewController CustomSegue; 但是,默认的展开segue不再适用于任何其他展开segue.虽然在super上调用方法会返回一个展开segue,但segue永远不会发生,视图控制器永远不会弹出,并且用户永远不会返回到前一个屏幕.所以要清楚一点,如果我使用常规show segue,相应的unwind segue会调用不推荐使用的方法,该方法在super上调用方法,但不起作用.

我在故事板上观看了WWDC的演讲,我能够在iOS 9中修复此问题:a)不再在我的自定义导航控制器中覆盖此方法,b)进入故事板,单击自定义segue,然后输入CustomSegue作为Segue Class.不幸的是,由于我的目标是iOS 7,我收到警告"只有自定义segues支持iOS 9之前的类名",而自定义展开segue现在不适用于iOS 7或iOS 8!

backwards-compatibility ios unwind-segue ios9 xcode7

6
推荐指数
1
解决办法
3359
查看次数