Skip to content

Method: purchases.subscriptionsv2.get #30

@abhishekgoyaldev

Description

@abhishekgoyaldev

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch google-play-billing-validator@2.1.3 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/google-play-billing-validator/index.js b/node_modules/google-play-billing-validator/index.js
index ccc86bf..6a149ae 100644
--- a/node_modules/google-play-billing-validator/index.js
+++ b/node_modules/google-play-billing-validator/index.js
@@ -34,7 +34,7 @@ Verifier.prototype.verifySub = function (receipt) {
   this.options.body = "";
   this.options.json = false;
   
-  let urlPattern = "https://www.googleapis.com/androidpublisher/v3/applications/%s/purchases/subscriptions/%s/tokens/%s";
+  let urlPattern = "https://androidpublisher.googleapis.com/androidpublisher/v3/applications/%s/purchases/subscriptionsv2/tokens/%s";
   if ("developerPayload" in receipt) {
     urlPattern += ":acknowledge";
     this.options.body = {
@@ -43,7 +43,7 @@ Verifier.prototype.verifySub = function (receipt) {
     this.options.method = 'post';
     this.options.json = true;
   }
-  let finalUrl = util.format(urlPattern, encodeURIComponent(receipt.packageName), encodeURIComponent(receipt.productId), encodeURIComponent(receipt.purchaseToken));
+  let finalUrl = util.format(urlPattern, encodeURIComponent(receipt.packageName), encodeURIComponent(receipt.purchaseToken));
   
   return this.verify(finalUrl)
 };

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions