Open abhishekgoyaldev opened 12 months ago
diff --git a/node_modules/google-play-billing-validator/index.js b/node_modules/google-play-billing-validator/index.js
index ccc86bf..47f2d44 100644
--- a/node_modules/google-play-billing-validator/index.js
+++ b/node_modules/google-play-billing-validator/index.js
@@ -34,16 +34,20 @@ 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";
+ let finalUrl = ""
if ("developerPayload" in receipt) {
+ urlPattern = "https://androidpublisher.googleapis.com/androidpublisher/v3/applications/%s/purchases/subscriptions/%s/tokens/%s";
urlPattern += ":acknowledge";
this.options.body = {
"developerPayload": receipt.developerPayload
}
this.options.method = 'post';
this.options.json = true;
+ finalUrl = util.format(urlPattern, encodeURIComponent(receipt.packageName), encodeURIComponent(receipt.productId), encodeURIComponent(receipt.purchaseToken));
+ }else{
+ finalUrl = util.format(urlPattern, encodeURIComponent(receipt.packageName), encodeURIComponent(receipt.purchaseToken));
}
- let finalUrl = util.format(urlPattern, encodeURIComponent(receipt.packageName), encodeURIComponent(receipt.productId), encodeURIComponent(receipt.purchaseToken));
return this.verify(finalUrl)
};
This issue body was partially generated by patch-package.
@abhishekgoyaldev it works perfect!
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:
This issue body was partially generated by patch-package.