voltrue2 / in-app-purchase

A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
http://iap.gracenode.org
Other
1.04k stars 287 forks source link

Setup for Google Play store #345

Open famictech2000 opened 3 years ago

famictech2000 commented 3 years ago

Sorry I'm new to android and Play store.

I am having difficulty with what I need to provide in the following configurations:

What is meant by client email??? googleServiceAccount: { clientEmail: '', privateKey: '' },

also what privatekey is this referring to and where could I obtain it????

Lastly, the key paths; I am not sure where I can obtain them, and do I need to provide a path or can I just provide the key info in the script!?

googlePublicKeyPath: 'path/to/public/key/directory/', // this is the path to the directory containing iap-sanbox/iap-live files
googlePublicKeyStrSandBox: 'publicKeySandboxString', // this is the google iap-sandbox public key string
googlePublicKeyStrLive: 'publicKeyLiveString', // this is the google iap-live public key string

Any help would be really appreciated!!!

MatheusMoura17 commented 2 years ago

@famictech2000 you can find clientEmail and privateKey in Google Service Account,

Service Account is part of IAM GCP, to improve security beteween services.

1 - Find/create project in Google Cloud Console 2 - Go to IAM option in left menu. 3 - Create a new Service Account and download JSON file.

Read this article for more.

EDIT: googlePublicKeyPath,googlePublicKeyStrSandBox and googlePublicKeyStrLive is not necessary if your using Service Account.

MatheusMoura17 commented 2 years ago

@famictech2000 I found this link recently, it should help you

https://stackoverflow.com/a/56390408

famictech2000 commented 2 years ago

Awesome thanks!! I'll take a look at it later today!

Now I just need to understand why my receipt validation always fails, with my other issue I opened up ;)