gpt4 book ai didi

ios - Paypal iOS SDK 从 future 的支付同意中获取用户个人资料信息

转载 作者:太空宇宙 更新时间:2023-11-03 16:08:04 26 4
gpt4 key购买 nike

我一直在想,一旦用户使用移动 sdk 登录,我如何才能从 future 的支付同意对话框中获得用户同意提供信息(姓名、电子邮件等)。现在我执行 future 支付同意时,它不会要求用户分享他们的信息,也不会返回任何与用户相关的信息。然而,我注意到在像 Munchery 这样的应用程序中,用户登录后的同意 UI 会要求用户同意 future 的付款并分享他们的姓名和电子邮件。所有这些都是在一种形式上完成的,其措辞与当前 SDK 中似乎可用的措辞不同。

有人问了类似的问题here但是使用配置文件共享 View Controller 会显示一个完全独立的登录和同意表单,最终需要连续两次登录。在 2.0 版本的 SDK 中是否仍然可以在同一时间从用户那里获得 future 的付款和个人资料信息同意?谢谢。

最佳答案

answer是正确的,但不是很有帮助,所以我们是这样做的。

Profile Sharing Mobile Integration Paypal 的功能完全符合您的要求 - 授权 future 付款并在同一次调用中返回用户信息。您可以在一个登录流程中完成所有操作。用户确实会看到一个显示应用请求的范围的额外屏幕,但不必进行第二次登录。

这是我们使用的代码片段:

func profileController() -> PayPalProfileSharingViewController {
PayPalMobile.preconnectWithEnvironment(PayPalEnvironmentSandbox)//PayPalEnvironmentNoNetwork)
let scope: Set<String> = Set([kPayPalOAuth2ScopeEmail, kPayPalOAuth2ScopeFuturePayments])
let controller = PayPalProfileSharingViewController(scopeValues: scope, configuration: self.paypalConfiguration!, delegate: self)
return controller!
}

func payPalProfileSharingViewController(profileSharingViewController: PayPalProfileSharingViewController, userDidLogInWithAuthorization profileSharingAuthorization: [NSObject : AnyObject]) {
self.processAuthorization(profileSharingAuthorization)
}

func userDidCancelPayPalProfileSharingViewController(profileSharingViewController: PayPalProfileSharingViewController) {
self.delegate?.didFailPayPalConsent()
}

func processAuthorization(authorization: [NSObject: AnyObject]) {
if let authCode = authorization["response"]?["code"] as? String {
self.delegate?.didSucceedPayPalConsent(authCode)
}
else {
self.delegate?.didFailPayPalConsent()
}
}

编辑:移动 Controller 为您提供具有个人资料信息权限的授权 token ,但您必须从服务器端代码再次调用该信息:

https://developer.paypal.com/docs/api/#get-user-information

关于ios - Paypal iOS SDK 从 future 的支付同意中获取用户个人资料信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32463148/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com