gpt4 book ai didi

android - Android 应用程序 Api 1 与 Api 2 中的 Google Pay

转载 作者:行者123 更新时间:2023-12-03 15:21:25 24 4
gpt4 key购买 nike

我已经在 Stripe 网站上浏览了这个集成教程,其中显示了我假设在 Api 版本 1 中的 Google Pay 集成。
https://stripe.com/docs/mobile/android/google-pay

但现在我发现,从 2018 年 7 月开始,Google Pay 有了新的 Api 版本 2。

https://developers.google.com/pay/api/android/guides/tutorial

我可以看到这个新的 api 更多地基于 JSON,使用字符串键值而不是强类型约束。

Api 版本 1 是否已弃用?
是否有适用于 Android 的 Api 版本 2 强类型等效项?
Stripe 会支持 Api 版本 2 吗?
如果我继续使用 Api 版本 1,我会失去什么?例如,3D 安全卡会起作用吗?还是从客户的角度来看版本号无关紧要?

我可以看到这是一些新的东西:

private static JSONArray getAllowedCardAuthMethods() {
return new JSONArray()
.put("PAN_ONLY")
.put("CRYPTOGRAM_3DS");
}

最佳答案

Is Api version 1 deprecated?



不,至少现在还没有。

Is there Api version 2 strongly-typed equivalent for Android?



当前的 API 提供了对象生成器和 json,例如 IsReadyToPayRequest.newBuilder()IsReadyToPayRequest.fromJson() ,但是 json 是新的首选方法,并提供了其他功能:

Key point: The new JSON-based request objects include features and functionality not available to apps that use the previous Builder implementation.

“在之前版本的 Google Pay API 中,我们使用的 Builder 对象仅支持卡作为 IsReadyToPayRequest 或 PaymentDataRequest 的一种支付方式。在最新版本的 Google Pay API 中,卡支付方式只是多种可能的支付方式之一IsReadyToPayRequest 或 PaymentDataRequest 的方法。”

What I lose if I stay with Api version 1? Will for instance 3D secure cards work? or version number doesn't matter from client perspective?



https://developers.google.com/pay/api/android/guides/resources/update-to-latest-version
详细介绍了构建器和 json API 之间的转换,包括标记卡:
If your app supported PAYMENT_METHOD_TOKENIZED_CARD:

Add "CRYPTOGRAM_3DS" to the allowedAuthMethods array.

所以 3DS 可以通过 WalletConstants.PAYMENT_METHOD_TOKENIZED_CARD 与 builder API 一起使用

关于android - Android 应用程序 Api 1 与 Api 2 中的 Google Pay,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54019409/

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