6

No One on Whole of Stack overflow no one has answer to this, I dont know why , has no one worked with Google pay on android?? . According to google :

Follow this link :

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

it talks about key rotation which is mandatory when using DIRECT integration in your App , means if you are not using a payment processor directly/explicitly.

here is what it says :

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.

See the screenshot below from the above link . Can any one click on this link and tell me why it takes you to support page instead of Google pay developer account ?

enter image description here

Questions :

  1. How to create a google pay developer account ? Do i need to pay ? My company already has a google pay console account ( Where you manage and upload apps to goole play store )

  2. Where and how will i generate public key ?

  3. where and how will i upload this public key in google pay developer profile ?

The one who will explain these steps with clear example and screenshots will be given bounty.

EDIT Okay I have generated public and private key using Terminal application on my mac .. Here is the screenshot : enter image description here

Now I need to upload this key into the Google Pay developer account and I can't see any link or any tutorial describing how can i create one if i have to integrate google-Pay into my android App.

Community
  • 1
  • 1
YogiAR
  • 2,207
  • 23
  • 44

3 Answers3

4

How to create a google pay developer account?

You need to sign up for production access: https://developers.google.com/pay/api/web/guides/test-and-deploy/request-prod-access

Do i need to pay?

No, you do not need to pay.

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

The Google Pay Developer Profile is different from the Google Play developer console. If you don't have a Google Pay Developer profile you will need to sign up for one.

Where and how will i generate public key?

The following link provides details on how to generate a public key using OpenSSL: https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#using-openssl

Important bits:

# 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?

The public key needs to be added to both the Google Pay Developer Profile and included as part of the payment request: https://developers.google.com/pay/api/android/reference/request-objects#direct

Note that you need to be registered with Google Pay for DIRECT integration.

Example:

"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?

If you are logged in with a Google account with access to the Google Pay Developer Profile, you see the Google Pay Developer Profile details. If you are not logged in or do not have access to the profile you will be redirected to the support page.

You need to be signed into your Google Account which has access to the Google Pay Developer Profile.

EDIT: Corrected information about uploading the public key.

UPDATE: Google Pay has recently launched the Business Console to sign up and manage Google Pay integrations.

Soc
  • 7,425
  • 4
  • 13
  • 30
  • thanks a alot @Soc .. this is the explanation i was looking for . I really really appreciate this. Just one question though , How much time it takes to get access for Production and test ( Integration ) access? I first want to try Test environment and then once API team in department is ready then we can go live and then i would sign up for production access. I have already signed up for Integration ( Test) access – YogiAR Oct 18 '19 at 20:01
  • 1
    No problem. FYI, I've updated the answer to include a correction on public key – Soc Oct 18 '19 at 22:34
  • @Soc Is is necessary to register even though just testing demo purpose? Because it is not needed for "gateway" method for running the quickstart-demo – Hardy Nov 30 '19 at 05:55
  • @Hardy, registration isn't required to receive a token however in TEST, you will [never get the actual card details back](https://developers.google.com/pay/api/web/guides/resources/sample-tokens). Instead, you will get a constant token back. If all you care about is making the UI work, then the only thing you need is a valid public key to pass into the request. You can use the one from this [JSFiddle](https://jsfiddle.net/pxsb4jhn/) which was taken from: https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography#public-key-format – Soc Nov 30 '19 at 07:14
  • @Soc But your given demo is still displaying "There are no accepted cards available for use with this merchant." – Hardy Nov 30 '19 at 08:28
  • @Hardy, that sounds like a problem with your Google account not having eligible payment methods. Which country are you/Google account based in? – Soc Dec 02 '19 at 17:29
  • @Soc India , But i am implementing it for some client who is outside india. – Hardy Dec 02 '19 at 18:13
  • For testing purposes, are you able to create a new Google account based in another country (the US for example), and add a payment method to it and test again? – Soc Dec 02 '19 at 18:15
2

For sure answer lies here : https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#key-rotation

I checked this link almost 50 times .. and i don't know if a true native android or iOS developer will be able to understand this or not .. but we need to go through each and every step of link below carefully ..

Still cant get the clear answer of how to create or find a google pay developer profile

YogiAR
  • 2,207
  • 23
  • 44
2

I'm sure you don't have to pay for it. You have to apply for it with this form

Emre Akcan
  • 982
  • 10
  • 27
  • this is just a support form . My question was how can i create a "Google pay developer profile" as shown in screenshot image. – YogiAR Oct 18 '19 at 17:07
  • When you send this form, they get back to you and you can see your apps and you can activate – Emre Akcan Oct 18 '19 at 18:23
  • When you fill this form, another section opens(when they get back to you) and you select your app and it enables google pay for your app. – Emre Akcan Oct 18 '19 at 19:19
  • @EmreAkcan then why they have mentioned to create "a Google Pay Developer profile" ? because there is no specific link to create it. – Hardy Dec 09 '19 at 11:52
  • @Hardy I believe its just misunderstanding, as I know if you have dev account, and you fill this form, you can get payment access. – Emre Akcan Dec 09 '19 at 20:04
  • Thanks Emre, so after filling that form, will they send a public key api ? Like they need here in DIRECT integration ? > https://i.snipboard.io/JUApzP.jpg – user3304007 Jan 23 '21 at 14:57