使用Swift 3无法使用Plaid沙箱在iOS上运行

时间:2017-05-26 00:34:33

标签: ios swift stripe-connect plaid

当我使用un:user_good和pw:pass_good时,我得到了附加的屏幕

并且它不会返回accessToken 我已经在AppDelegate中添加了我的公钥

   [![@IBAction fu][1]][1]nc plaidConnectButton(_ sender: Any) {
    let plaidLink = PLDLinkNavigationViewController(environment: .tartan, product: .connect)!

    plaidLink.linkDelegate = self
    plaidLink.providesPresentationContextTransitionStyle = true
    plaidLink.definesPresentationContext = true
    plaidLink.modalPresentationStyle = .custom

    self.present(plaidLink, animated: true, completion: nil)
}


func linkNavigationContoller(_ navigationController: PLDLinkNavigationViewController!, didFinishWithAccessToken accessToken: String!) {
    print("success \(accessToken)")
    myAPIClient.connectAddBank(bankToken: accessToken, completion:{
        (error) in
        if(error != nil) {
            print(error.debugDescription)
        } else {
            print("successfully added bank")
            self.dismiss(animated: true, completion: nil)
        }
    })

}

func linkNavigationControllerDidFinish(withBankNotListed navigationController: PLDLinkNavigationViewController!) {
    print("Manually enter bank info?")
    self.performSegue(withIdentifier: "unlistedBankSegue", sender: self)
}

func linkNavigationControllerDidCancel(_ navigationController: PLDLinkNavigationViewController!) {
    self.dismiss(animated: true, completion: nil)
}

请帮忙

1 个答案:

答案 0 :(得分:0)

在初始化过程中将您的环境设置为 .sandbox

格子支持链接:https://github.com/plaid/link/issues/140