googleapis / googleapis/google-api-nodejs-client

Create direct API purchase request in google store

Open
#2,999 0 comments 1 reaction 0 assignees View on GitHub
priority: p3 type: question
Dominant language
TypeScript
Stars
12.2k
Forks
2k
Avg merge
1d 9h
Merged PRs (30d)
24

Description

Hey ! We have some additional logic for purchasing in google store, so we are interesting in testing all flow, but just from API perspective. Everything setup on client, client sends all data to backend. Still we are interesting exactly in backend test, but without client.

Just in case, does this real, to do purchase using from backend side, without client ?

In case this is real, our request contains from several fields, main of them:

- receipt
- rawData
- signature

**Receipt field** on client we are taking from getOriginalJson method:
https://developer.android.com/reference/com/android/billingclient/api/Purchase#getOriginalJson()
**rawData field** the most interesting thing their "_purchaseToken_"
**signature field** on client we are taking from getSignature method:
https://developer.android.com/reference/com/android/billingclient/api/Purchase#getSignature()

For example about signature field, probably the most interesting one, according do doc:

> Returns String containing the signature of the purchase data that was signed with the private key of the developer. The data signature uses the RSASSA-PKCS1-v1_5 scheme

Sounds that we can do that by ourself, still in RSASSA-PKCS1-v1_5 can work on client with specific options, like length, hash etc. In case it is possible, can someone give more info what options we need to use ?

Main question, does nodejs client, may be another library, provides some useful methods out of the box to help us (receipt, and especially signature) ? (I looked there but did no find, may be missed) ?

I will be very grateful for any tips, suggestion, thanks in advance !

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.