{"id":1046,"date":"2023-01-25T17:29:28","date_gmt":"2023-01-25T17:29:28","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=1046"},"modified":"2023-01-24T09:46:22","modified_gmt":"2023-01-24T09:46:22","slug":"ionic-cordova-in-app-purchase-event-data-dumps","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/ionic-cordova-in-app-purchase-event-data-dumps\/","title":{"rendered":"Ionic Cordova In-App Purchase Plugin Events Data Dumps"},"content":{"rendered":"<p>Below are the dumps of data received in ionic cordova app from Google billing or in-app purchase plugin events.<\/p>\n<p>See this article for a summarized version &#8211; <a title=\"State changes during an in-app purchase in Ionic Cordova\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/state-changes-during-an-in-app-purchase-in-ionic-cordova\/\">State changes during an in-app purchase in Ionic Cordova<\/a><\/p>\n<pre class='wp-code-highlight prettyprint'>this.store.get(my_product_id)\r\n\r\n{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"valid\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":true,\"owned\":false,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":null,\"transaction\":null,\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true}\r\n\r\n\r\nthis.store.products\r\n\r\nProducts: [{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"valid\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":true,\"owned\":false,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":null,\"transaction\":null,\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true}]\r\n\r\n\r\n\r\nthis.store.when(my_product_id).updated((product: IAPProduct) \r\n\r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"valid\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":true,\"owned\":false,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":null,\"transaction\":null,\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true}\r\n\r\n\r\nAFTER THE PURCHASE INITIATED -- Not Owned or Expired\r\n\r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"requested\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":false,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":null,\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true}\r\nlogin.page.ts:108 \r\n\r\nthis.store.order(\"com.myapp.annualsubscription2\").then(async (result) \r\n\r\nstore.Product\u00a0{id: 'com.myapp.annualsubscription2', alias: 'com.myapp.annualsubscription2', type: 'paid subscription', group: 'default', state: 'initiated',\u00a0\u2026}\r\nlogin.page.ts:80 \r\n\r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"initiated\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":false,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":null,\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true}\r\n\r\n\r\n------------------------------\r\nWhen already purchased and valid - if tried to purchase it will call \"Updated\" and the below data will be returned. Owned is true and canPurchase is false\r\n\r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"requested\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\",\"oldSku\":\"com.myapp.annualsubscription2\",\"oldPurchaseToken\":\"imggoijiflaahpaefffokpom.AO-J1OyBHUqG13A6fFZjQ2wVGo08oGFHh5ilnnwlnJ1-5dUGTEr7xt2IhejvGmuYPxNMSVyKnzcZHx93X7d0lkPgX9jOGRiSCgj2Iw7gXnYHfJ_l231h-I8\"},\"transaction\":{\"type\":\"android-playstore\",\"id\":\"GPA.3345-8962-9923-27341\",\"purchaseToken\":\"imggoijiflaahpaefffokpom.AO-J1OyBHUqG13A6fFZjQ2wVGo08oGFHh5ilnnwlnJ1-5dUGTEr7xt2IhejvGmuYPxNMSVyKnzcZHx93X7d0lkPgX9jOGRiSCgj2Iw7gXnYHfJ_l231h-I8\",\"purchaseState\":0,\"receipt\":\"{\"orderId\":\"GPA.3345-8962-9923-27341\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672226442183,\"purchaseState\":0,\"purchaseToken\":\"imggoijiflaahpaefffokpom.AO-J1OyBHUqG13A6fFZjQ2wVGo08oGFHh5ilnnwlnJ1-5dUGTEr7xt2IhejvGmuYPxNMSVyKnzcZHx93X7d0lkPgX9jOGRiSCgj2Iw7gXnYHfJ_l231h-I8\",\"autoRenewing\":true,\"acknowledged\":true}\",\"signature\":\"EZEp+5T\/YNruAJwcJL0xBYxV9ZZDTMxM5cj3UZArlrS3F2aToJx8G7ZE7YJyl2iv99QyaLrjJGeqlFVRtUmW+zEzV\/JtyYGwPdUqtatejYkZGTijFF01k\/396HFJK29kE0MOV89EQr\/6AncpuVjVGrP9Akg7\/jdqk5LDgiQSBygT+ISZPTRBZQsQhx2rZoT+l2FabxRmxU3ojt\/93bvWFKRaPVb9CNWmGkiw55E\/652CDlkxbV8SzoaSRkW08vSFz3T1cKWW\/BcRwLCjVdmdOHQzvm4tbUMJkHPgt+XimI7FdQBkvCRWtWujBA63Hus80hwAqseGaGzZaiaC3+WpKg==\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":true,\"renewalIntent\":\"Renew\"}\r\n\r\n\r\n\r\nAFTER PURCHASE IS DONE\r\n---------------------------------\r\n\r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"initiated\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":{\"type\":\"android-playstore\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":true,\"renewalIntent\":\"Renew\"}\r\n\r\nlogin.page.ts:80 \r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"approved\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":{\"type\":\"android-playstore\",\"id\":\"GPA.3316-7182-4489-05118\",\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"purchaseState\":0,\"receipt\":\"{\"orderId\":\"GPA.3316-7182-4489-05118\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672228274746,\"purchaseState\":0,\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"autoRenewing\":true,\"acknowledged\":false}\",\"signature\":\"PZ\/BRKILYTgVhQV8ZRe4Gxnqw9GcwSItEcreABctaMLGvNaGYLmNwM\/bUHJc\/C293TK4RFPJOBaGMgKD72zaOPkxeffFoe9zzh+1zRbCdCuUce4xPdsIepxhO30kIpdT+0jXoASM8U4duRGYiMcaPlBpVQOTQwtcnmjtOhHQbKtF7kosE8Mev3cpn5PTh2lPcNpio4LSuEc6akZtgXctMkkCOw5asrg8g9dUdgzavMgPc1vofcWQxU7L4XyvuQJsNW55MWNV4aMpIu6+yNJ8nfjSXRK77x130v8CtzHaN5taX7DQff5dYvtx5zcWrxjWfIJUNuuAWEwkIP3k\/nCLtw==\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":true,\"renewalIntent\":\"Renew\"}\r\n\r\nlogin.page.ts:80 \r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"approved\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":{\"type\":\"android-playstore\",\"id\":\"GPA.3316-7182-4489-05118\",\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"purchaseState\":0,\"receipt\":\"{\"orderId\":\"GPA.3316-7182-4489-05118\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672228274746,\"purchaseState\":0,\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"autoRenewing\":true,\"acknowledged\":false}\",\"signature\":\"PZ\/BRKILYTgVhQV8ZRe4Gxnqw9GcwSItEcreABctaMLGvNaGYLmNwM\/bUHJc\/C293TK4RFPJOBaGMgKD72zaOPkxeffFoe9zzh+1zRbCdCuUce4xPdsIepxhO30kIpdT+0jXoASM8U4duRGYiMcaPlBpVQOTQwtcnmjtOhHQbKtF7kosE8Mev3cpn5PTh2lPcNpio4LSuEc6akZtgXctMkkCOw5asrg8g9dUdgzavMgPc1vofcWQxU7L4XyvuQJsNW55MWNV4aMpIu6+yNJ8nfjSXRK77x130v8CtzHaN5taX7DQff5dYvtx5zcWrxjWfIJUNuuAWEwkIP3k\/nCLtw==\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":false,\"renewalIntent\":\"Renew\"}\r\n\r\nlogin.page.ts:80 \r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"approved\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":{\"type\":\"android-playstore\",\"id\":\"GPA.3316-7182-4489-05118\",\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"purchaseState\":0,\"receipt\":\"{\"orderId\":\"GPA.3316-7182-4489-05118\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672228274746,\"purchaseState\":0,\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"autoRenewing\":true,\"acknowledged\":false}\",\"signature\":\"PZ\/BRKILYTgVhQV8ZRe4Gxnqw9GcwSItEcreABctaMLGvNaGYLmNwM\/bUHJc\/C293TK4RFPJOBaGMgKD72zaOPkxeffFoe9zzh+1zRbCdCuUce4xPdsIepxhO30kIpdT+0jXoASM8U4duRGYiMcaPlBpVQOTQwtcnmjtOhHQbKtF7kosE8Mev3cpn5PTh2lPcNpio4LSuEc6akZtgXctMkkCOw5asrg8g9dUdgzavMgPc1vofcWQxU7L4XyvuQJsNW55MWNV4aMpIu6+yNJ8nfjSXRK77x130v8CtzHaN5taX7DQff5dYvtx5zcWrxjWfIJUNuuAWEwkIP3k\/nCLtw==\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":false,\"renewalIntent\":\"Renew\"}\r\n\r\nlogin.page.ts:80 \r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"approved\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":{\"type\":\"android-playstore\",\"id\":\"GPA.3316-7182-4489-05118\",\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"purchaseState\":0,\"receipt\":\"{\"orderId\":\"GPA.3316-7182-4489-05118\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672228274746,\"purchaseState\":0,\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"autoRenewing\":true,\"acknowledged\":false}\",\"signature\":\"PZ\/BRKILYTgVhQV8ZRe4Gxnqw9GcwSItEcreABctaMLGvNaGYLmNwM\/bUHJc\/C293TK4RFPJOBaGMgKD72zaOPkxeffFoe9zzh+1zRbCdCuUce4xPdsIepxhO30kIpdT+0jXoASM8U4duRGYiMcaPlBpVQOTQwtcnmjtOhHQbKtF7kosE8Mev3cpn5PTh2lPcNpio4LSuEc6akZtgXctMkkCOw5asrg8g9dUdgzavMgPc1vofcWQxU7L4XyvuQJsNW55MWNV4aMpIu6+yNJ8nfjSXRK77x130v8CtzHaN5taX7DQff5dYvtx5zcWrxjWfIJUNuuAWEwkIP3k\/nCLtw==\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":false,\"renewalIntent\":\"Renew\"}\r\n\r\nlogin.page.ts:80 \r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"finished\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":{\"type\":\"android-playstore\",\"id\":\"GPA.3316-7182-4489-05118\",\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"purchaseState\":0,\"receipt\":\"{\"orderId\":\"GPA.3316-7182-4489-05118\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672228274746,\"purchaseState\":0,\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"autoRenewing\":true,\"acknowledged\":false}\",\"signature\":\"PZ\/BRKILYTgVhQV8ZRe4Gxnqw9GcwSItEcreABctaMLGvNaGYLmNwM\/bUHJc\/C293TK4RFPJOBaGMgKD72zaOPkxeffFoe9zzh+1zRbCdCuUce4xPdsIepxhO30kIpdT+0jXoASM8U4duRGYiMcaPlBpVQOTQwtcnmjtOhHQbKtF7kosE8Mev3cpn5PTh2lPcNpio4LSuEc6akZtgXctMkkCOw5asrg8g9dUdgzavMgPc1vofcWQxU7L4XyvuQJsNW55MWNV4aMpIu6+yNJ8nfjSXRK77x130v8CtzHaN5taX7DQff5dYvtx5zcWrxjWfIJUNuuAWEwkIP3k\/nCLtw==\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":false,\"renewalIntent\":\"Renew\"}\r\n\r\nlogin.page.ts:80 \r\nUpdated{\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"owned\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":{\"applicationUsername\":\"\"},\"transaction\":{\"type\":\"android-playstore\",\"id\":\"GPA.3316-7182-4489-05118\",\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"purchaseState\":0,\"receipt\":\"{\"orderId\":\"GPA.3316-7182-4489-05118\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672228274746,\"purchaseState\":0,\"purchaseToken\":\"geeofnjlooihoghajeghgfah.AO-J1Ozu_V7ScY_5aC2hM-t0sMMgERU56UNaypCX4FjJ_yGPpLAxiMbvN4oraW_iUfqlGyAiSLgbTbofrv4-81HP-AQGY_FtCAc05xLRrd2GXb31Cr3IO0o\",\"autoRenewing\":true,\"acknowledged\":false}\",\"signature\":\"PZ\/BRKILYTgVhQV8ZRe4Gxnqw9GcwSItEcreABctaMLGvNaGYLmNwM\/bUHJc\/C293TK4RFPJOBaGMgKD72zaOPkxeffFoe9zzh+1zRbCdCuUce4xPdsIepxhO30kIpdT+0jXoASM8U4duRGYiMcaPlBpVQOTQwtcnmjtOhHQbKtF7kosE8Mev3cpn5PTh2lPcNpio4LSuEc6akZtgXctMkkCOw5asrg8g9dUdgzavMgPc1vofcWQxU7L4XyvuQJsNW55MWNV4aMpIu6+yNJ8nfjSXRK77x130v8CtzHaN5taX7DQff5dYvtx5zcWrxjWfIJUNuuAWEwkIP3k\/nCLtw==\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":true,\"renewalIntent\":\"Renew\"}\r\n\r\n\r\nthis.store.order(\"com.myapp.annualsubscription2\").then\r\n\r\nFirst it is giving the OLD details \/\/NOTE \r\n\"state\" is \"initiated\"\r\n\"purchaseState\" is \"0\",\r\n\"renewalIntent\" is \"Lapse\"\r\n{\r\n    \"id\": \"com.myapp.annualsubscription2\",\r\n    \"alias\": \"com.myapp.annualsubscription2\",\r\n    \"type\": \"paid subscription\",\r\n    \"group\": \"default\",\r\n    \"state\": \"initiated\",\r\n    \"title\": \"Annual Subscription\",\r\n    \"description\": \"Play unlimited with an Annual Subscription\",\r\n    \"priceMicros\": 4000000,\r\n    \"price\": \"\u20b94.00\",\r\n    \"currency\": \"INR\",\r\n    \"countryCode\": null,\r\n    \"loaded\": true,\r\n    \"canPurchase\": false,\r\n    \"owned\": true,\r\n    \"introPrice\": \"\",\r\n    \"introPriceMicros\": \"\",\r\n    \"introPricePeriod\": null,\r\n    \"introPriceNumberOfPeriods\": null,\r\n    \"introPricePeriodUnit\": null,\r\n    \"introPriceSubscriptionPeriod\": null,\r\n    \"introPricePaymentMode\": null,\r\n    \"ineligibleForIntroPrice\": null,\r\n    \"discounts\": [],\r\n    \"downloading\": false,\r\n    \"downloaded\": false,\r\n    \"additionalData\": {\r\n        \"applicationUsername\": \"\"\r\n    },\r\n    \"transaction\": {\r\n        \"type\": \"android-playstore\",\r\n        \"id\": \"GPA.3399-8293-2056-78889\",\r\n        \"purchaseToken\": \"gihamknkcpkdldnpbbknpopk.AO-J1Ox79aJrQexjiainR5XBKtsk-WmcJ70bhYzps1khZ6U53b91n2-U8eIKZUnOh9jZqVOcE-a12eqJtp_GowFcEaLrxMkq2b5bCzIPCQ207rFWVMPQBz8\",\r\n        \"purchaseState\": 0,\r\n        \"receipt\": \"{\"orderId\":\"GPA.3399-8293-2056-78889\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672254433028,\"purchaseState\":0,\"purchaseToken\":\"gihamknkcpkdldnpbbknpopk.AO-J1Ox79aJrQexjiainR5XBKtsk-WmcJ70bhYzps1khZ6U53b91n2-U8eIKZUnOh9jZqVOcE-a12eqJtp_GowFcEaLrxMkq2b5bCzIPCQ207rFWVMPQBz8\",\"autoRenewing\":false,\"acknowledged\":true}\",\r\n        \"signature\": \"rRZXyzwlehHBYcQir2QFYiAEncB8uFPyVX5OoS2whERDS+yObqtDV4GQTZ6vSRt6NzmU1PXMXLRoWR5vW82PhZ9FlNqLvQ6Z3EYe\/NfUy3xAtKE5fxpFlVxqiiJ70S9RWsN0WfDTkluj7Tp4Jkm2eH1ciHBlnxkYWkuWtxmQlL3s7DI1W\/PpIDh\/ao+w5IJI\/H1\/QJ7svZezu\/Da4dtz8TZoxX7nI8sib14ryjjU40zvcDc4i5B1wdJ+SdWrByHlEsGr\/ZvwR7SkXVp6Oeq0bm47uIyqu+vN6X8RM0cdtGQ08w0UeHPtHM9ssKWrYJvZS9S4lIO8IAT+tD\/F7Gxc9w==\"\r\n    },\r\n    \"trialPeriod\": null,\r\n    \"trialPeriodUnit\": null,\r\n    \"billingPeriod\": 1,\r\n    \"billingPeriodUnit\": \"Year\",\r\n    \"valid\": true,\r\n    \"acknowledged\": true,\r\n    \"renewalIntent\": \"Lapse\"\r\n}\r\n\r\n\r\n\/\/\/\/\/\/\/ THE AUTO RENEW KEEPS RENEWING AUTOMATICALLY -- THE PURCHASE TIME REMAINS SAME, THE ORIGINAL PURCHASE TIME. \r\nOwned: {\"id\":\"com.myapp.annualsubscription2\",\"alias\":\"com.myapp.annualsubscription2\",\"type\":\"paid subscription\",\"group\":\"default\",\"state\":\"owned\",\"title\":\"Annual Subscription\",\"description\":\"Play unlimited with an Annual Subscription\",\"priceMicros\":4000000,\"price\":\"\u20b94.00\",\"currency\":\"INR\",\"countryCode\":null,\"loaded\":true,\"canPurchase\":false,\"owned\":true,\"introPrice\":\"\",\"introPriceMicros\":\"\",\"introPricePeriod\":null,\"introPriceNumberOfPeriods\":null,\"introPricePeriodUnit\":null,\"introPriceSubscriptionPeriod\":null,\"introPricePaymentMode\":null,\"ineligibleForIntroPrice\":null,\"discounts\":[],\"downloading\":false,\"downloaded\":false,\"additionalData\":null,\"transaction\":{\"type\":\"android-playstore\",\"id\":\"GPA.3375-4850-7157-68633\",\"purchaseToken\":\"oonhpdlmpllpgdgejmamjcbl.AO-J1Ow5YVxekuyW31hJVFx0klzO40IaO3_CKwCYE41Wp-GHLPM8OcPxIM1oUcuxfVY70cldN52tT3MS79yDewB6VI6xPctTihxRKKh_os7Z9Jk7LIqm-HI\",\"purchaseState\":0,\"receipt\":\"{\"orderId\":\"GPA.3375-4850-7157-68633\",\"packageName\":\"com.synchrodipity.psychiccircuit\",\"productId\":\"com.myapp.annualsubscription2\",\"purchaseTime\":1672304595703,\"purchaseState\":0,\"purchaseToken\":\"oonhpdlmpllpgdgejmamjcbl.AO-J1Ow5YVxekuyW31hJVFx0klzO40IaO3_CKwCYE41Wp-GHLPM8OcPxIM1oUcuxfVY70cldN52tT3MS79yDewB6VI6xPctTihxRKKh_os7Z9Jk7LIqm-HI\",\"autoRenewing\":true,\"acknowledged\":true}\",\"signature\":\"HepM1z7VCy1S\/faOftTsIx0RsntF4HmNPwzeY8WsoGwPyec2y9RLThCNx0zlaFcD21EGBV7ljLDCQD6WHC8WrBrzJwHqqFFZpF7JD\/WbwiiWz4MbIoSIePoq8pLO8LMDEp2RDt+PquvYF8H55wqIlUiOPCxofHWU74NejI3w7xJ+k0njASpUj1lYgkA3nW+Yr5DpuK+OoYd0p3M7Ve2tR9kKpvTxfIiDL1ZIoS7cDtYm9\/9RzsZakqp7CI7Y3a5dDyl1JYKLN5DQBsJhkClMavde9o6EakREWspeLqarh98xtUbff1kqdZQNEIMY8KXpYOS2bjrjQjsfP3GbT+dm5Q==\"},\"trialPeriod\":null,\"trialPeriodUnit\":null,\"billingPeriod\":1,\"billingPeriodUnit\":\"Year\",\"valid\":true,\"acknowledged\":true,\"renewalIntent\":\"Renew\"}\r\n\r\n\r\n\/\/\/ON CANCELLED \r\nThe RENEWAL INTENT becomes : Lapse\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/PURCHASE CANCELLED IS CALLED WHEN THE USER CANCELS THE SUBSCRIPTION POPUP\r\n\r\n\r\n<\/pre>\n<p>Please note the plugin doesn&#8217;t return any expiry date<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below are the dumps of data received in ionic cordova app from Google billing or in-app purchase plugin events. See this article for a summarized version &#8211; State changes during an in-app purchase in Ionic Cordova this.store.get(my_product_id) {&#8220;id&#8221;:&#8221;com.myapp.annualsubscription2&#8243;,&#8221;alias&#8221;:&#8221;com.myapp.annualsubscription2&#8243;,&#8221;type&#8221;:&#8221;paid subscription&#8221;,&#8221;group&#8221;:&#8221;default&#8221;,&#8221;state&#8221;:&#8221;valid&#8221;,&#8221;title&#8221;:&#8221;Annual Subscription&#8221;,&#8221;description&#8221;:&#8221;Play unlimited with an Annual Subscription&#8221;,&#8221;priceMicros&#8221;:4000000,&#8221;price&#8221;:&#8221;\u20b94.00&#8243;,&#8221;currency&#8221;:&#8221;INR&#8221;,&#8221;countryCode&#8221;:null,&#8221;loaded&#8221;:true,&#8221;canPurchase&#8221;:true,&#8221;owned&#8221;:false,&#8221;introPrice&#8221;:&#8221;&#8221;,&#8221;introPriceMicros&#8221;:&#8221;&#8221;,&#8221;introPricePeriod&#8221;:null,&#8221;introPriceNumberOfPeriods&#8221;:null,&#8221;introPricePeriodUnit&#8221;:null,&#8221;introPriceSubscriptionPeriod&#8221;:null,&#8221;introPricePaymentMode&#8221;:null,&#8221;ineligibleForIntroPrice&#8221;:null,&#8221;discounts&#8221;:[],&#8221;downloading&#8221;:false,&#8221;downloaded&#8221;:false,&#8221;additionalData&#8221;:null,&#8221;transaction&#8221;:null,&#8221;trialPeriod&#8221;:null,&#8221;trialPeriodUnit&#8221;:null,&#8221;billingPeriod&#8221;:1,&#8221;billingPeriodUnit&#8221;:&#8221;Year&#8221;,&#8221;valid&#8221;:true} this.store.products Products: [{&#8220;id&#8221;:&#8221;com.myapp.annualsubscription2&#8243;,&#8221;alias&#8221;:&#8221;com.myapp.annualsubscription2&#8243;,&#8221;type&#8221;:&#8221;paid subscription&#8221;,&#8221;group&#8221;:&#8221;default&#8221;,&#8221;state&#8221;:&#8221;valid&#8221;,&#8221;title&#8221;:&#8221;Annual Subscription&#8221;,&#8221;description&#8221;:&#8221;Play unlimited with an Annual Subscription&#8221;,&#8221;priceMicros&#8221;:4000000,&#8221;price&#8221;:&#8221;\u20b94.00&#8243;,&#8221;currency&#8221;:&#8221;INR&#8221;,&#8221;countryCode&#8221;:null,&#8221;loaded&#8221;:true,&#8221;canPurchase&#8221;:true,&#8221;owned&#8221;:false,&#8221;introPrice&#8221;:&#8221;&#8221;,&#8221;introPriceMicros&#8221;:&#8221;&#8221;,&#8221;introPricePeriod&#8221;:null,&#8221;introPriceNumberOfPeriods&#8221;:null,&#8221;introPricePeriodUnit&#8221;:null,&#8221;introPriceSubscriptionPeriod&#8221;:null,&#8221;introPricePaymentMode&#8221;:null,&#8221;ineligibleForIntroPrice&#8221;:null,&#8221;discounts&#8221;:[],&#8221;downloading&#8221;:false,&#8221;downloaded&#8221;:false,&#8221;additionalData&#8221;:null,&#8221;transaction&#8221;:null,&#8221;trialPeriod&#8221;:null,&#8221;trialPeriodUnit&#8221;:null,&#8221;billingPeriod&#8221;:1,&#8221;billingPeriodUnit&#8221;:&#8221;Year&#8221;,&#8221;valid&#8221;:true}]&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/ionic-cordova-in-app-purchase-event-data-dumps\/\">Continue reading <span class=\"screen-reader-text\">Ionic Cordova In-App Purchase Plugin Events Data Dumps<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[404,397,402,403,396],"class_list":["post-1046","post","type-post","status-publish","format-standard","hentry","category-miscellaneous","tag-android-billing-client-receipt","tag-cordova","tag-in-app-pucrchase","tag-in-app-pucrchase2","tag-ionic","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/1046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=1046"}],"version-history":[{"count":4,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/1046\/revisions"}],"predecessor-version":[{"id":1053,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/1046\/revisions\/1053"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=1046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=1046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=1046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}