android - Google pay 开发者帐户在哪里以及如何生成公钥并上传到其中?

标签 android google-pay key-rotation

没有人对整个堆栈溢出没有人回答这个问题,我不知道为什么,没有人在 Android 上使用 Google Pay 吗? 。根据谷歌:

点击此链接:

https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#key-rotation

它讨论了 key 轮换,这是在您的应用程序中使用直接集成时强制执行的,这意味着如果您不直接/明确使用支付处理器。

这里是这样说的:

Key rotation : If you decrypt a payment method token directly on your servers with direct integration, then you must rotate the keys annually.

To rotate encryption keys:

  1. Use OpenSSL to generate a new key pair.
  2. Open your Google Pay Developer Profile while signed in with the Google Account used to manage your app in Google Play Console Under the "Public encryption keys" section, select the Add an encryption key button. Then, select the "Public encryption key" text input field and add your newly generated public key Base64-encoded in uncompressed point format. Click Save.

请参阅上面链接中的下面的屏幕截图。谁能点击此链接并告诉我为什么您需要转到支持页面而不是 Google Pay 开发者帐户?

enter image description here

问题:

  1. 如何创建 Google Pay 开发者帐户?我需要付费吗?我的公司已经有一个 google pay 控制台帐户(您可以在其中管理应用程序并将其上传到 goole play 商店)

  2. 我将在哪里以及如何生成公钥?

  3. 我将在 Google Pay 开发者资料中的何处以及如何上传此公钥?

用清晰的示例和屏幕截图解释这些步骤的人将获得赏金。

编辑 好的,我已经使用我的 Mac 上的终端应用程序生成了公钥和私钥。这是屏幕截图:enter image description here

现在,我需要将此 key 上传到 Google Pay 开发者帐户,但我看不到任何链接或任何说明如何创建 key (如果我必须将 google-Pay 集成到我的 Android 应用程序中)的教程。

最佳答案

How to create a google pay developer account?

您需要注册生产访问权限:https://developers.google.com/pay/api/web/guides/test-and-deploy/request-prod-access

Do i need to pay?

不,您不需要付费。

My company already has a google pay console account ( Where you manage and upload apps to goole play store )

Google Pay 开发者资料与 Google Play 开发者控制台不同。如果您没有 Google Pay 开发者资料,则需要注册一份。

Where and how will i generate public key?

以下链接提供了有关如何使用 OpenSSL 生成公钥的详细信息:https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#using-openssl

重要信息:

# generate private key
openssl ecparam -name prime256v1 -genkey -noout -out key.pem

# generate a base64-encoded public key
openssl ec -in key.pem -pubout -text -noout 2> /dev/null | grep "pub:" -A5 | sed 1d | xxd -r -p | base64 | paste -sd "\0" -

Where and how will i upload this public key in google pay developer profile?

公钥需要添加到 Google Pay 开发者资料中并包含在付款请求中:https://developers.google.com/pay/api/android/reference/request-objects#direct

请注意,您需要注册 Google Pay 才能进行 DIRECT 集成。

示例:

"tokenizationSpecification": {
  "type": "DIRECT",
  "parameters": {
    "protocolVersion": "ECv2",
    "publicKey": "BOdoXP1aiNp.....kh3JUhiSZKHYF2Y="
  }
}

Can any one click on this link and tell me why it takes you to support page instead of Google pay developer account?

如果您使用可访问 Google Pay 开发者资料的 Google 帐户登录,您会看到 Google Pay Developer Profile细节。如果您尚未登录或无权访问个人资料,您将被重定向到 support page .

您需要登录可以访问 Google Pay 开发者资料的 Google 帐户。

编辑:更正了有关上传公钥的信息。

更新:Google Pay 最近推出了 Business Console注册并管理 Google Pay 集成。

关于android - Google pay 开发者帐户在哪里以及如何生成公钥并上传到其中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58327500/

相关文章:

android - 如何检测 Android 4.2 中的 USB 连接?

android - 谷歌支付使用 Stripe : Getting an unexpected developer error in Android

google-tasks-api - 取消Google付款单

android - key 轮换后,我是否仍然需要旧 key 来签署应用程序的更新?

c# - 如何从 C# 代码轮换 Azure 存储帐户访问 key ?

android - 移动应用程序后端

java - Android Java中递归文件夹删除(API17)

android - setClickable() 被 onClickListener 阻挠

javascript - Google Pay(通过付款请求 API)- canMakePayment() 无法解析