Invalid Value at Gaxios._request (/srv/node_modules/googleapis-common/node_modules/gaxios/build/src/gaxios.js:89:23)

后端 未结 1 1284
野趣味
野趣味 2021-01-26 03:58

I am trying to make a request to the google to verify my IAP purchase but I keep getting the error

Invalid Value at Gaxios._request (/srv/node_modules/googleapis-         


        
相关标签:
1条回答
  • 2021-01-26 04:24

    Maybe you want to try initializing the Google API like this:

    const playDeveloperApiClient = google.androidpublisher('v3');
    

    And add auth to:

    const subscription = await playDeveloperApiClient.purchases.subscriptions.get({
                    auth: authClient,
                    packageName: packageName, 
                    subscriptionId: purchase.id,
                    token: purchase.token
                });
    

    For the purchase.id I find it odd that you are using a number for the Id, ideally you would want to put a string as I mentioned in the comments, just in case, it should be the Product ID in your Subscriptions section in the Play Console as highlighted in the picture below:

    0 讨论(0)
提交回复
热议问题