Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renewalIntent stays "Renew" after downgrading with DEFERRED mode on Android #1313

Open
angjelkom opened this issue Jul 20, 2022 · 0 comments

Comments

@angjelkom
Copy link

angjelkom commented Jul 20, 2022

Observed behavior

After downgrading a subscription with DEFERRED mode the old subscription that is still active still has the renewalIntent: "Renew" although that subscription won't be renewed after it get's expired and instead the new DEFERRED subscription will get active:

  • Subscribe to 4.99€
  • After subscribing, downgrade to 1.99€ with prorationMode DEFERRED
  • 4.99€ Subscription is still active which is OK
  • 4.99€ Subscription renewalIntent says "Renew" instead of "Lapse" which is not OK as the subscription won't be renewed anymore after it expires and instead the 1.99€ Subscription will become the active one after 4.99€ Subscription Expires.
  • This confuses the end user as he thinks the 4.99€ will still get renewed
  • close the app
  • re-open the app
  • 4.99€ Subscription still has renewalIntent: "Renew"

Include logs with store.verbosity = store.DEBUG

[store.js] DEBUG: product data -> for sub_199
store-android.js:2192 [store.js] DEBUG:              -> "OK"
store-android.js:3016 InAppBilling[js]: listener: {"type":"purchasesUpdated","data":{"purchases":[{"orderId":"some-order-id","packageName":"io.cordova","productId":"sub_499","purchaseTime":1658309627183,"purchaseState":0,"purchaseToken":"some-purchase-token","obfuscatedAccountId":"some-account-id","quantity":1,"autoRenewing":true,"acknowledged":true,"getPurchaseState":1,"signature":"some-signature","receipt":"{\"orderId\":\"some-order-id\",\"packageName\":\"io.cordova\",\"productId\":\"sub_499\",\"purchaseTime\":1658309627183,\"purchaseState\":0,\"purchaseToken\":\"some-purchase-token\",\"obfuscatedAccountId\":\"some-account-id\",\"quantity\":1,\"autoRenewing\":true,\"acknowledged\":true}"}]}}
store-android.js:2192 [store.js] DEBUG: iabPurchasesUpdated: [{"orderId":"some-order-id","packageName":"io.cordova","productId":"sub_499","purchaseTime":1658309627183,"purchaseState":0,"purchaseToken":"some-purchase-token","obfuscatedAccountId":"some-account-id","quantity":1,"autoRenewing":true,"acknowledged":true,"getPurchaseState":1,"signature":"some-signature","receipt":"{\"orderId\":\"some-order-id\",\"packageName\":\"io.cordova\",\"productId\":\"sub_499\",\"purchaseTime\":1658309627183,\"purchaseState\":0,\"purchaseToken\":\"some-purchase-token\",\"obfuscatedAccountId\":\"some-account-id\",\"quantity\":1,\"autoRenewing\":true,\"acknowledged\":true}"}]
store-android.js:2192 [store.js] DEBUG: iabUpdatePurchases: [{"orderId":"some-order-id","packageName":"io.cordova","productId":"sub_499","purchaseTime":1658309627183,"purchaseState":0,"purchaseToken":"some-purchase-token","obfuscatedAccountId":"some-account-id","quantity":1,"autoRenewing":true,"acknowledged":true,"getPurchaseState":1,"signature":"some-signature","receipt":"{\"orderId\":\"some-order-id\",\"packageName\":\"io.cordova\",\"productId\":\"sub_499\",\"purchaseTime\":1658309627183,\"purchaseState\":0,\"purchaseToken\":\"some-purchase-token\",\"obfuscatedAccountId\":\"some-account-id\",\"quantity\":1,\"autoRenewing\":true,\"acknowledged\":true}"}]
store-android.js:2192 [store.js] DEBUG: product data -> for sub_499
store-android.js:2192 [store.js] DEBUG:              -> {"orderId":"some-order-id","packageName":"io.cordova","productId":"sub_499","purchaseTime":1658309627183,"purchaseState":0,"purchaseToken":"some-purchase-token","obfuscatedAccountId":"some-account-id","quantity":1,"autoRenewing":true,"acknowledged":true,"getPurchaseState":1,"signature":"some-signature","receipt":"{\"orderId\":\"some-order-id\",\"packageName\":\"io.cordova\",\"productId\":\"sub_499\",\"purchaseTime\":1658309627183,\"purchaseState\":0,\"purchaseToken\":\"some-purchase-token\",\"obfuscatedAccountId\":\"some-account-id\",\"quantity\":1,\"autoRenewing\":true,\"acknowledged\":true}"}

Expected behavior

renewalIntent should change to "Lapse" after downgrading

System Info

Output of cordova info.

Cordova Packages:

    cli: 11.0.0
        common: 4.0.2
        create: 4.0.0
        lib: 11.0.0
            common: 4.0.2
            fetch: 3.0.1
            serve: 4.0.0

Project Installed Platforms:

    android: 10.1.2

Project Installed Plugins:

    cc.fovea.cordova.openwith: 2.1.0
    cordova-plugin-awesome-shared-preferences: 0.1.0
    cordova-plugin-backbutton: 0.3.0
    cordova-plugin-badge: 0.8.8
    cordova-plugin-calendar: 4.5.5
    cordova-plugin-chooser: 1.3.1
    cordova-plugin-contacts: 3.0.2-dev
    cordova-plugin-customurlscheme: 5.0.2
    cordova-plugin-deeplinks: 1.1.1
    cordova-plugin-device: 2.1.0
    cordova-plugin-dialogs: 2.0.2
    cordova-plugin-file: 7.0.0-dev
    cordova-plugin-firebasex: 13.0.1
    cordova-plugin-google-analytics: 1.9.1
    cordova-plugin-inappbrowser: 5.0.0
    cordova-plugin-local-notification: 0.9.0-beta.4
    cordova-plugin-locale: 2.0.2
    cordova-plugin-network-information: 3.0.0
    cordova-plugin-printer: 0.8.0
    cordova-plugin-purchase: 11.0.0
    cordova-plugin-safariviewcontroller: 2.0.0
    cordova-plugin-splashscreen: 6.0.1
    cordova-plugin-statusbar: 2.4.3
    cordova-plugin-theme-detection: 1.3.0
    cordova-plugin-x-socialsharing: 6.0.3
    es6-promise-plugin: 4.2.2
    phonegap-plugin-mobile-accessibility: 1.0.5-dev
    skwas-cordova-plugin-datetimepicker: 2.1.2

Environment:

    OS: macOS Monterey 12.3.1 (21E258) (darwin 21.4.0) x64
    Node: v17.9.0
    npm: 8.7.0

android Environment:

    android:
Available Android targets:==============] 100% Fetch remote repository...       
----------
id: 1 or "android-30"
     Name: Android API 30
     Type: Platform
     API level: 30
     Revision: 3
----------
id: 2 or "android-31"
     Name: Android API 31
     Type: Platform
     API level: 31
     Revision: 1
----------
id: 3 or "android-32"
     Name: Android API 32
     Type: Platform
     API level: 32
     Revision: 1


Project Setting Files:

    config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova" version="7.4.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
    <name>Cordova App</name>
    <description>
        Sample
    </description>
    <author email="contact@cordova.io" href="http://cordova.io">
        Cordova team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <preference name="hostname" value="cordova.io" />
        <preference name="AndroidInsecureFileModeEnabled" value="true" />
        <allow-intent href="market:*" />
        <preference name="AndroidXEnabled" value="true" />
        <preference name="AndroidLaunchMode" value="singleInstance" />
    </platform>
</widget>

    package.json:
--- Start of Cordova JSON Snippet ---
{
  "plugins": {
    "cordova-plugin-device": {},
    "cordova-plugin-dialogs": {},
    "cordova-plugin-file": {},
    "cordova-plugin-inappbrowser": {},
    "cordova-plugin-network-information": {},
    "cordova-plugin-splashscreen": {},
    "cordova-plugin-backbutton": {},
    "cordova-plugin-badge": {},
    "cordova-plugin-calendar": {},
    "cordova-plugin-chooser": {},
    "cordova-plugin-contacts": {},
    "cordova-plugin-statusbar": {},
    "cordova-plugin-customurlscheme": {
      "URL_SCHEME": "cordova",
      "ANDROID_SCHEME": " ",
      "ANDROID_HOST": " ",
      "ANDROID_PATHPREFIX": "/"
    },
    "cc.fovea.cordova.openwith": {},
    "cordova-plugin-awesome-shared-preferences": {},
    "cordova-plugin-deeplinks": {},
    "cordova-plugin-x-socialsharing": {},
    "phonegap-plugin-mobile-accessibility": {},
    "cordova-plugin-firebasex": {
      "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true",
      "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true",
      "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true",
      "ANDROID_ICON_ACCENT": "#FF00FFFF",
      "ANDROID_FIREBASE_PERFORMANCE_MONITORING": "false",
      "ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0",
      "ANDROID_PLAY_SERVICES_AUTH_VERSION": "19.0.0",
      "ANDROID_FIREBASE_ANALYTICS_VERSION": "19.0.0",
      "ANDROID_FIREBASE_MESSAGING_VERSION": "22.0.0",
      "ANDROID_FIREBASE_CONFIG_VERSION": "21.0.0",
      "ANDROID_FIREBASE_PERF_VERSION": "20.0.2",
      "ANDROID_FIREBASE_AUTH_VERSION": "21.0.1",
      "ANDROID_FIREBASE_INAPPMESSAGING_VERSION": "20.0.0",
      "ANDROID_FIREBASE_FIRESTORE_VERSION": "23.0.2",
      "ANDROID_FIREBASE_FUNCTIONS_VERSION": "20.0.0",
      "ANDROID_FIREBASE_IID_VERSION": "21.1.0",
      "ANDROID_FIREBASE_INSTALLATIONS_VERSION": "17.0.0",
      "ANDROID_FIREBASE_CRASHLYTICS_VERSION": "18.1.0",
      "ANDROID_FIREBASE_CRASHLYTICS_NDK_VERSION": "18.1.0",
      "ANDROID_GSON_VERSION": "2.8.7",
      "ANDROID_FIREBASE_PERF_GRADLE_PLUGIN_VERSION": "1.4.0"
    },
    "cordova-plugin-google-analytics": {
      "GMS_VERSION": "17.0.0"
    },
    "cordova-plugin-local-notification": {
      "ANDROID_SUPPORT_V4_VERSION": "26.+"
    },
    "cordova-plugin-printer": {
      "ANDROID_SUPPORT_V4_VERSION": "28.+"
    },
    "skwas-cordova-plugin-datetimepicker": {},
    "cordova-plugin-locale": {},
    "cordova-plugin-theme-detection": {},
    "cordova-plugin-safariviewcontroller": {},
    "cordova-plugin-purchase": {
      "BILLING_KEY": "THE KEY"
    }
  },
  "platforms": [
    "android"
  ]
}
--- End of Cordova JSON Snippet ---
@angjelkom angjelkom changed the title renewalIntent stays "Renew" after downgrading with DEFFERRED mode on Android renewalIntent stays "Renew" after downgrading with DEFERRED mode on Android Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant