google-api-nodejs-client
google-api-nodejs-client copied to clipboard
Create direct API purchase request in google store
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 !