j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.3k stars 535 forks source link

Issue when making a purchase upon switching from WiFi to mobile network or experiencing a disconnection. #1463

Open developOPQA opened 1 year ago

developOPQA commented 1 year ago

Observed behavior

Hello, I've identified an issue during the purchase process when there's a network switch. The issue arises when the Google Play message "Purchase has been completed successfully" is displayed. If I switch from WiFi to a mobile network at that exact moment, I call the method transaction.verify(). Upon receiving the verified() event, I then invoke the method transaction.finish() inside the verified event handler. Executing this finish() method results in the error "onFailure An internal error occurred." with the error code 6777013. After attempting to consume the purchase, I have a button to trigger the method store.restorePurchases(). When triggered, it produces the error "onFailure ITEM_ALREADY_CONSUMED" with the error code 6777003. If I then close and reopen the application at this point, it detects a pending purchase and processes it successfully. This behavior is consistent whether I switch networks or lose and then regain the connection after a few seconds. Making a purchase under normal conditions works fine, and if I close the app after seeing the "Purchase has been completed successfully" message and then reopen it, it also processes correctly. The issue arises exclusively during network changes.

[CdvPurchase] INFO: order(0_creditos_20) store.js:334 [CdvPurchase.GooglePlay] INFO: Order - {"className":"Offer","id":"0_creditos_20","pricingPhases":[{"price":"0,59 €","priceMicros":590000,"currency":"EUR","recurrenceMode":"NON_RECURRING"}],"productId":"0_creditos_20","productType":"consumable","platform":"android-playstore","type":"inapp"} store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: buy() store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: listener: {"type":"purchasesUpdated","data":{"purchases":[{"orderId":"GPA.3319-3650-9319-63600","packageName":"com.opqa","productId":"0_creditos_20","purchaseTime":1694157401173,"purchaseState":0,"purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","quantity":1,"acknowledged":false,"productIds":["0_creditos_20"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"UKF0VUjOr7Qh7Xbl6cKlma3ZVbwBC/9qqqR6n3emEWN8aH1woEnnhcj910jS7DoKu0BbDauU7l/5qB8vVQVAMYSOWIQGGB0oXj1XIlTvZfgF2/5G9IwM6JE3t6qLlTHDuVc2IlvTk6TEZ2vzNZli/K9UbTpsW6pC8OrtWoLxOhyhbaSHLs1LyPlXTeOBUqUqbXA3hfLd1YqRboe+z5Ve5Qq4b0Ieo0bNxf6toedjYTK/F9s0nosbpcMNWU1yvC34sH2LoVf7CnyVXHZJxt6CKxueM12y0aGCKsoe25v2qLdxBy6yBne47mvgoiKzR3nWybY1uFvzxdox3kGXyE3iQQ==","receipt":"{\"orderId\":\"GPA.3319-3650-9319-63600\",\"packageName\":\"com.opqa\",\"productId\":\"0_creditos_20\",\"purchaseTime\":1694157401173,\"purchaseState\":0,\"purchaseToken\":\"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg\",\"quantity\":1,\"acknowledged\":false}"}]}} store.js:334 [CdvPurchase.GooglePlay] DEBUG: onPurchaseUpdated: GPA.3319-3650-9319-63600 store.js:334 [CdvPurchase] DEBUG: Calling callback: type=receiptUpdated() name=_receiptUpdated store.js:334 [CdvPurchase] DEBUG: Calling callback: type=approved() name= store.js:334 [CdvPurchase] DEBUG: Calling callback: type=approved() name=finishPurchase index.js:97 p.state approved store.js:334 [CdvPurchase] INFO: verify(Transaction) store.js:334 [CdvPurchase.Validator] DEBUG: Schedule validation: {"className":"Transaction","transactionId":"GPA.3319-3650-9319-63600","state":"approved","products":[{"id":"0_creditos_20"}],"platform":"android-playstore","nativePurchase":{"orderId":"GPA.3319-3650-9319-63600","packageName":"com.opqa","productId":"0_creditos_20","purchaseTime":1694157401173,"purchaseState":0,"purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","quantity":1,"acknowledged":false,"productIds":["0_creditos_20"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"UKF0VUjOr7Qh7Xbl6cKlma3ZVbwBC/9qqqR6n3emEWN8aH1woEnnhcj910jS7DoKu0BbDauU7l/5qB8vVQVAMYSOWIQGGB0oXj1XIlTvZfgF2/5G9IwM6JE3t6qLlTHDuVc2IlvTk6TEZ2vzNZli/K9UbTpsW6pC8OrtWoLxOhyhbaSHLs1LyPlXTeOBUqUqbXA3hfLd1YqRboe+z5Ve5Qq4b0Ieo0bNxf6toedjYTK/F9s0nosbpcMNWU1yvC34sH2LoVf7CnyVXHZJxt6CKxueM12y0aGCKsoe25v2qLdxBy6yBne47mvgoiKzR3nWybY1uFvzxdox3kGXyE3iQQ==","receipt":"{\"orderId\":\"GPA.3319-3650-9319-63600\",\"packageName\":\"com.opqa\",\"productId\":\"0_creditos_20\",\"purchaseTime\":1694157401173,\"purchaseState\":0,\"purchaseToken\":\"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg\",\"quantity\":1,\"acknowledged\":false}"},"purchaseId":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","purchaseDate":"2023-09-08T07:16:41.173Z","isPending":false,"isAcknowledged":false,"renewalIntent":"Lapse"} store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=2 responses=2 store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=2 responses=3 store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=2 responses=4 store.js:334 [CdvPurchase.Validator] DEBUG: Register a new verified receipt. store.js:334 [CdvPurchase] DEBUG: Calling callback: type=verified() name=_verified store.js:334 [CdvPurchase] INFO: finish(VerifiedReceipt) store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: consumePurchase() store.js:4685 onFailure An internal error occurred. 6777013

///////--------- CLICK RESTORE PURCHASE ------------------------

store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: getPurchases() store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: listener: {"type":"setPurchases","data":{"purchases":[]}} store.js:334 [CdvPurchase.GooglePlay] DEBUG: onSetPurchases: [] store.js:334 [CdvPurchase.GooglePlay] DEBUG: onPurchaseUpdated: store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: listener: {"type":"setPurchases","data":{"purchases":[{"orderId":"GPA.3319-3650-9319-63600","packageName":"com.opqa","productId":"0_creditos_20","purchaseTime":1694157401173,"purchaseState":0,"purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","quantity":1,"acknowledged":false,"productIds":["0_creditos_20"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"UKF0VUjOr7Qh7Xbl6cKlma3ZVbwBC/9qqqR6n3emEWN8aH1woEnnhcj910jS7DoKu0BbDauU7l/5qB8vVQVAMYSOWIQGGB0oXj1XIlTvZfgF2/5G9IwM6JE3t6qLlTHDuVc2IlvTk6TEZ2vzNZli/K9UbTpsW6pC8OrtWoLxOhyhbaSHLs1LyPlXTeOBUqUqbXA3hfLd1YqRboe+z5Ve5Qq4b0Ieo0bNxf6toedjYTK/F9s0nosbpcMNWU1yvC34sH2LoVf7CnyVXHZJxt6CKxueM12y0aGCKsoe25v2qLdxBy6yBne47mvgoiKzR3nWybY1uFvzxdox3kGXyE3iQQ==","receipt":"{\"orderId\":\"GPA.3319-3650-9319-63600\",\"packageName\":\"com.opqa\",\"productId\":\"0_creditos_20\",\"purchaseTime\":1694157401173,\"purchaseState\":0,\"purchaseToken\":\"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg\",\"quantity\":1,\"acknowledged\":false}"}]}} store.js:334 [CdvPurchase.GooglePlay] DEBUG: onSetPurchases: [{"orderId":"GPA.3319-3650-9319-63600","packageName":"com.opqa","productId":"0_creditos_20","purchaseTime":1694157401173,"purchaseState":0,"purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","quantity":1,"acknowledged":false,"productIds":["0_creditos_20"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"UKF0VUjOr7Qh7Xbl6cKlma3ZVbwBC/9qqqR6n3emEWN8aH1woEnnhcj910jS7DoKu0BbDauU7l/5qB8vVQVAMYSOWIQGGB0oXj1XIlTvZfgF2/5G9IwM6JE3t6qLlTHDuVc2IlvTk6TEZ2vzNZli/K9UbTpsW6pC8OrtWoLxOhyhbaSHLs1LyPlXTeOBUqUqbXA3hfLd1YqRboe+z5Ve5Qq4b0Ieo0bNxf6toedjYTK/F9s0nosbpcMNWU1yvC34sH2LoVf7CnyVXHZJxt6CKxueM12y0aGCKsoe25v2qLdxBy6yBne47mvgoiKzR3nWybY1uFvzxdox3kGXyE3iQQ==","receipt":"{\"orderId\":\"GPA.3319-3650-9319-63600\",\"packageName\":\"com.opqa\",\"productId\":\"0_creditos_20\",\"purchaseTime\":1694157401173,\"purchaseState\":0,\"purchaseToken\":\"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg\",\"quantity\":1,\"acknowledged\":false}"}] store.js:334 [CdvPurchase.GooglePlay] DEBUG: onPurchaseUpdated: GPA.3319-3650-9319-63600 store.js:334 [CdvPurchase] DEBUG: Calling callback: type=receiptUpdated() name=_receiptUpdated store.js:334 [CdvPurchase] DEBUG: Calling callback: type=approved() name= store.js:334 [CdvPurchase] DEBUG: Calling callback: type=approved() name=finishPurchase index.js:97 p.state approved store.js:334 [CdvPurchase] INFO: verify(Transaction) store.js:334 [CdvPurchase.Validator] DEBUG: Schedule validation: {"className":"Transaction","transactionId":"GPA.3319-3650-9319-63600","state":"approved","products":[{"id":"0_creditos_20"}],"platform":"android-playstore","nativePurchase":{"orderId":"GPA.3319-3650-9319-63600","packageName":"com.opqa","productId":"0_creditos_20","purchaseTime":1694157401173,"purchaseState":0,"purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","quantity":1,"acknowledged":false,"productIds":["0_creditos_20"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"UKF0VUjOr7Qh7Xbl6cKlma3ZVbwBC/9qqqR6n3emEWN8aH1woEnnhcj910jS7DoKu0BbDauU7l/5qB8vVQVAMYSOWIQGGB0oXj1XIlTvZfgF2/5G9IwM6JE3t6qLlTHDuVc2IlvTk6TEZ2vzNZli/K9UbTpsW6pC8OrtWoLxOhyhbaSHLs1LyPlXTeOBUqUqbXA3hfLd1YqRboe+z5Ve5Qq4b0Ieo0bNxf6toedjYTK/F9s0nosbpcMNWU1yvC34sH2LoVf7CnyVXHZJxt6CKxueM12y0aGCKsoe25v2qLdxBy6yBne47mvgoiKzR3nWybY1uFvzxdox3kGXyE3iQQ==","receipt":"{\"orderId\":\"GPA.3319-3650-9319-63600\",\"packageName\":\"com.opqa\",\"productId\":\"0_creditos_20\",\"purchaseTime\":1694157401173,\"purchaseState\":0,\"purchaseToken\":\"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg\",\"quantity\":1,\"acknowledged\":false}"},"purchaseId":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","purchaseDate":"2023-09-08T07:16:41.173Z","isPending":false,"isAcknowledged":false,"renewalIntent":"Lapse"} store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=3 responses=4 store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=3 responses=5 store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=3 responses=6 store.js:334 [CdvPurchase.Validator] DEBUG: Updating existing receipt. store.js:334 [CdvPurchase] DEBUG: Calling callback: type=verified() name=_verified store.js:334 [CdvPurchase] INFO: finish(VerifiedReceipt) store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: consumePurchase() store.js:4685 onFailure ITEM_ALREADY_CONSUMED 6777003

///////--------- CLOSE APP AND REOPEN ------------------------

[CdvPurchase.Adapters] INFO: GooglePlay receipts loaded: [{"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"GPA.3319-3650-9319-63600","state":"approved","products":[{"id":"0_creditos_20"}],"platform":"android-playstore","nativePurchase":{"orderId":"GPA.3319-3650-9319-63600","packageName":"com.opqa","productId":"0_creditos_20","purchaseTime":1694157401173,"purchaseState":0,"purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","quantity":1,"acknowledged":false,"productIds":["0_creditos_20"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"UKF0VUjOr7Qh7Xbl6cKlma3ZVbwBC/9qqqR6n3emEWN8aH1woEnnhcj910jS7DoKu0BbDauU7l/5qB8vVQVAMYSOWIQGGB0oXj1XIlTvZfgF2/5G9IwM6JE3t6qLlTHDuVc2IlvTk6TEZ2vzNZli/K9UbTpsW6pC8OrtWoLxOhyhbaSHLs1LyPlXTeOBUqUqbXA3hfLd1YqRboe+z5Ve5Qq4b0Ieo0bNxf6toedjYTK/F9s0nosbpcMNWU1yvC34sH2LoVf7CnyVXHZJxt6CKxueM12y0aGCKsoe25v2qLdxBy6yBne47mvgoiKzR3nWybY1uFvzxdox3kGXyE3iQQ==","receipt":"{\"orderId\":\"GPA.3319-3650-9319-63600\",\"packageName\":\"com.opqa\",\"productId\":\"0_creditos_20\",\"purchaseTime\":1694157401173,\"purchaseState\":0,\"purchaseToken\":\"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg\",\"quantity\":1,\"acknowledged\":false}"},"purchaseId":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","purchaseDate":"2023-09-08T07:16:41.173Z","isPending":false,"isAcknowledged":false,"renewalIntent":"Lapse"}],"platform":"android-playstore","purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","orderId":"GPA.3319-3650-9319-63600"}] store.js:334 [CdvPurchase.AdapterListener] DEBUG: setSupportedPlatforms: android-playstore store.js:334 [CdvPurchase] DEBUG: Calling callback: type=receiptsReady() name= store.js:334 [CdvPurchase.ReceiptsMonitor] DEBUG: receiptsReady... store.js:334 [CdvPurchase.ReceiptsMonitor] DEBUG: check(0/0) store.js:334 [CdvPurchase.ReceiptsMonitor] INFO: receiptsVerified() store.js:334 [CdvPurchase] INFO: verify(Transaction) store.js:334 [CdvPurchase.Validator] DEBUG: Schedule validation: {"className":"Transaction","transactionId":"GPA.3319-3650-9319-63600","state":"approved","products":[{"id":"0_creditos_20"}],"platform":"android-playstore","nativePurchase":{"orderId":"GPA.3319-3650-9319-63600","packageName":"com.opqa","productId":"0_creditos_20","purchaseTime":1694157401173,"purchaseState":0,"purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","quantity":1,"acknowledged":false,"productIds":["0_creditos_20"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"UKF0VUjOr7Qh7Xbl6cKlma3ZVbwBC/9qqqR6n3emEWN8aH1woEnnhcj910jS7DoKu0BbDauU7l/5qB8vVQVAMYSOWIQGGB0oXj1XIlTvZfgF2/5G9IwM6JE3t6qLlTHDuVc2IlvTk6TEZ2vzNZli/K9UbTpsW6pC8OrtWoLxOhyhbaSHLs1LyPlXTeOBUqUqbXA3hfLd1YqRboe+z5Ve5Qq4b0Ieo0bNxf6toedjYTK/F9s0nosbpcMNWU1yvC34sH2LoVf7CnyVXHZJxt6CKxueM12y0aGCKsoe25v2qLdxBy6yBne47mvgoiKzR3nWybY1uFvzxdox3kGXyE3iQQ==","receipt":"{\"orderId\":\"GPA.3319-3650-9319-63600\",\"packageName\":\"com.opqa\",\"productId\":\"0_creditos_20\",\"purchaseTime\":1694157401173,\"purchaseState\":0,\"purchaseToken\":\"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg\",\"quantity\":1,\"acknowledged\":false}"},"purchaseId":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","purchaseDate":"2023-09-08T07:16:41.173Z","isPending":false,"isAcknowledged":false,"renewalIntent":"Lapse"} store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=1 responses=0 store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=1 responses=1 store.js:334 [CdvPurchase.Validator] DEBUG: Validation requests=1 responses=2 store.js:334 [CdvPurchase.Validator] DEBUG: Register a new verified receipt. store.js:334 [CdvPurchase] DEBUG: Calling callback: type=verified() name=_verified store.js:334 [CdvPurchase] INFO: finish(VerifiedReceipt) store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: consumePurchase() store.js:334 [CdvPurchase.GooglePlay.Bridge] INFO: listener: {"type":"purchaseConsumed","data":{"purchase":{"orderId":"GPA.3319-3650-9319-63600","packageName":"com.opqa","productId":"0_creditos_20","purchaseTime":1694157401173,"purchaseState":0,"purchaseToken":"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg","quantity":1,"acknowledged":false,"productIds":["0_creditos_20"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"UKF0VUjOr7Qh7Xbl6cKlma3ZVbwBC/9qqqR6n3emEWN8aH1woEnnhcj910jS7DoKu0BbDauU7l/5qB8vVQVAMYSOWIQGGB0oXj1XIlTvZfgF2/5G9IwM6JE3t6qLlTHDuVc2IlvTk6TEZ2vzNZli/K9UbTpsW6pC8OrtWoLxOhyhbaSHLs1LyPlXTeOBUqUqbXA3hfLd1YqRboe+z5Ve5Qq4b0Ieo0bNxf6toedjYTK/F9s0nosbpcMNWU1yvC34sH2LoVf7CnyVXHZJxt6CKxueM12y0aGCKsoe25v2qLdxBy6yBne47mvgoiKzR3nWybY1uFvzxdox3kGXyE3iQQ==","receipt":"{\"orderId\":\"GPA.3319-3650-9319-63600\",\"packageName\":\"com.opqa\",\"productId\":\"0_creditos_20\",\"purchaseTime\":1694157401173,\"purchaseState\":0,\"purchaseToken\":\"fgcicpejdfkloeghccgjfllg.AO-J1OwRezoPSuU04z4-a0rt8rsCraSuvcEM2dGpfmcfkzC8GkJP_gKgKkNmoTY8Rx_LIGOL6abr2qLdD3yis_kh5ZNAjwq8Bg\",\"quantity\":1,\"acknowledged\":false}"}}} store.js:334 [CdvPurchase.GooglePlay] DEBUG: onPurchaseConsumed: GPA.3319-3650-9319-63600 store.js:334 [CdvPurchase.GooglePlay] DEBUG: onPurchaseUpdated: GPA.3319-3650-9319-63600 store.js:334 [CdvPurchase] DEBUG: Calling callback: type=receiptUpdated() name=_receiptUpdated store.js:334 [CdvPurchase] DEBUG: Calling callback: type=approved() name= store.js:334 [CdvPurchase] DEBUG: Calling callback: type=approved() name=finishPurchase index.js:97 p.state finished store.js:334 [CdvPurchase] DEBUG: Calling callback: type=receiptUpdated() name=_receiptUpdated store.js:334 [CdvPurchase] DEBUG: Calling callback: type=finished() name= store.js:334 [CdvPurchase] DEBUG: Calling callback: type=finished() name=_finished

System Info

SAMSUNG GALAXY S22Ultra Android 13

cordova info

Cordova Packages:

    cli: 12.0.0
        common: 5.0.0
        create: 5.0.0
        lib: 12.0.1
            common: 5.0.0
            fetch: 4.0.0
            serve: 4.0.1

Project Installed Platforms:

    android: 12.0.1

Project Installed Plugins:

    cordova-plugin-purchase: 13.8.0

Environment:

    OS: Pop 22.04 LTS (linux 6.4.6-76060406-generic) x64
    Node: v20.5.1
    npm: 9.8.0

android Environment:

    android:
ERROR: Command failed with ENOENT: avdmanager list target
spawn avdmanager ENOENT

Project Setting Files:

    config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.opqa" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>OPQA PAY</name>
    <description>Sample Apache Cordova App</description>
    <author email="dev@cordova.apache.org" href="https://cordova.apache.org">
        Apache 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">
        <allow-intent href="market:*" />
    </platform>
</widget>

    package.json:
--- Start of Cordova JSON Snippet ---
{
  "platforms": [
    "android"
  ],
  "plugins": {
    "cordova-plugin-purchase": {}
  }
}
--- End of Cordova JSON Snippet ---
maxvipon commented 1 year ago

I have encountered a similar issue with an ITEM_ALREADY_CONSUMED when making multiple purchases in a row. Only restarting the app helps.

Code

CdvPurchase.store.register({
    id: 'small_thanks',
    type: CdvPurchase.ProductType.CONSUMABLE,
    platform: CdvPurchase.Platform.GOOGLE_PLAY
});

CdvPurchase.store.error(function (error) {
    console.log('PURCHASE ERROR. code: ' + error.code + ': ' + error.message);
});

CdvPurchase.store.initialize()

…

CdvPurchase.store.get(purchaseId).getOffer().order()
    .then(function (error) {
        console.log('PURCHASE ERROR. code: ' + error.code + ': ' + error.message);
    });
CdvPurchase.store.when()
    .approved(function (transaction) {
        console.log('PURCHASE APPROVED', transaction.transactionId);
        transaction.verify();
        // transaction.finish();
    })
    .verified(function (receipt) {
        console.log('PURCHASE VERIFIED', receipt.id);
        receipt.finish()
    })
    .unverified(function (unverifiedReceipt) {
        console.log('PURCHASE UNVERIFIED', unverifiedReceipt.id);
    })
    .finished(function (transaction) {
        console.log('PURCHASE FINISHED', transaction.transactionId);
    });

Logcat

EGL_emulation           com.test.app      D  app_time_stats: avg=28.99ms min=1.69ms max=485.81ms count=28
rach.drugsearch         com.test.app      I  Compiler allocated 4579KB to compile void android.view.ViewRootImpl.performTraversals()
EGL_emulation           com.test.app      D  app_time_stats: avg=114.07ms min=1.95ms max=1428.63ms count=13
AssistStructure         com.test.app      I  Flattened final assist data: 4568 bytes, containing 1 windows, 6 views
AssistStructure         com.test.app      I  Flattened final assist data: 4568 bytes, containing 1 windows, 6 views
EGL_emulation           com.test.app      D  app_time_stats: avg=860.73ms min=7.51ms max=3372.30ms count=4
PluginManager           com.test.app      D  getPlugin - put: InAppBillingPlugin
CdvPurchase             com.test.app      D  sendToListener() -> ready
CdvPurchase             com.test.app      D              data -> {}
CdvPurchase             com.test.app      D  init()
CdvPurchase             com.test.app      D  startServiceConnection()
PluginManager           com.test.app      W  THREAD WARNING: exec() call to InAppBillingPlugin.init blocked the main thread for 21ms. Plugin should use CordovaInterface.getThreadPool().
CdvPurchase             com.test.app      D  startServiceConnection() -> Success
CdvPurchase             com.test.app      D  init() -> Success
CdvPurchase             com.test.app      D  getAvailableProducts()
CdvPurchase             com.test.app      D  queryAllProductDetails()
CdvPurchase             com.test.app      D  queryAllProductDetails() -> Query INAPP.
CdvPurchase             com.test.app      D  queryProductDetailsAsync()
CdvPurchase             com.test.app      D  executeServiceRequest() -> OK
CdvPurchase             com.test.app      D  queryProductDetailsAsync() -> Success
CdvPurchase             com.test.app      D  queryAllProductDetails() -> ProductDetails: Title: Big thanks (TEST APP)
CdvPurchase             com.test.app      D  queryAllProductDetails() -> ProductDetails: Title: Medium thanks (TEST APP)
CdvPurchase             com.test.app      D  queryAllProductDetails() -> ProductDetails: Title: Thanks (TEST APP)
CdvPurchase             com.test.app      D  queryAllProductDetails() -> Calling listener.
CdvPurchase             com.test.app      D  getAvailableProducts() -> productDetails: ProductDetails{jsonString='{"productId":"large_thanks","type":"inapp","title":"Big thanks (TEST APP)","name":"Big thanks","description":"Support the author","localizedIn":["ru_RU"],"skuDetailsToken":"AEuhp4Iiaem7OH2b5Woi9oWk2Zh0Fv7JxwfsHi1ozmJFT9rDs3nShENL_JvVtJjmUrg-","oneTimePurchaseOfferDetails":{"priceAmountMicros":299000000,"priceCurrencyCode":"RUB","formattedPrice":"RUB 299.00"}}', parsedJson={"productId":"large_thanks","type":"inapp","title":"Big thanks (TEST APP)","name":"Big thanks","description":"Support the author","localizedIn":["ru_RU"],"skuDetailsToken":"AEuhp4Iiaem7OH2b5Woi9oWk2Zh0Fv7JxwfsHi1ozmJFT9rDs3nShENL_JvVtJjmUrg-","oneTimePurchaseOfferDetails":{"priceAmountMicros":299000000,"priceCurrencyCode":"RUB","formattedPrice":"RUB 299.00"}}, productId='large_thanks', productType='inapp', title='Big thanks (TEST APP)', productDetailsToken='AEuhp4Iiaem7OH2b5Woi9oWk2Zh0Fv7JxwfsHi1ozmJFT9rDs3nShENL_JvVtJjmUrg-', subscriptionOfferDetails=null}
CdvPurchase             com.test.app      D  getAvailableProducts() -> productDetails: ProductDetails{jsonString='{"productId":"medium_thanks","type":"inapp","title":"Medium thanks (TEST APP)","name":"Medium thanks","description":"Support the author","localizedIn":["ru_RU"],"skuDetailsToken":"AEuhp4I7EGgH9jnbaM8mTSw_dNn5cQJ4KmQattd0u0P_2tpCXps_Ezrq_UzcREkUNuCg","oneTimePurchaseOfferDetails":{"priceAmountMicros":139000000,"priceCurrencyCode":"RUB","formattedPrice":"RUB 139.00"}}', parsedJson={"productId":"medium_thanks","type":"inapp","title":"Medium thanks (TEST APP)","name":"Medium thanks","description":"Support the author","localizedIn":["ru_RU"],"skuDetailsToken":"AEuhp4I7EGgH9jnbaM8mTSw_dNn5cQJ4KmQattd0u0P_2tpCXps_Ezrq_UzcREkUNuCg","oneTimePurchaseOfferDetails":{"priceAmountMicros":139000000,"priceCurrencyCode":"RUB","formattedPrice":"RUB 139.00"}}, productId='medium_thanks', productType='inapp', title='Medium thanks (TEST APP)', productDetailsToken='AEuhp4I7EGgH9jnbaM8mTSw_dNn5cQJ4KmQattd0u0P_2tpCXps_Ezrq_UzcREkUNuCg', subscriptionOfferDetails=null}
CdvPurchase             com.test.app      D  getAvailableProducts() -> productDetails: ProductDetails{jsonString='{"productId":"small_thanks","type":"inapp","title":"Thanks (TEST APP)","name":"Thanks","description":"Support the author","localizedIn":["ru_RU"],"skuDetailsToken":"AEuhp4JqIr-pLxKHokNLJH9I-2VtCWA9PdObL9SghOvlxJbv_hl3KmexUMFBS1BFIB8o","oneTimePurchaseOfferDetails":{"priceAmountMicros":69000000,"priceCurrencyCode":"RUB","formattedPrice":"RUB 69.00"}}', parsedJson={"productId":"small_thanks","type":"inapp","title":"Thanks (TEST APP)","name":"Thanks","description":"Support the author","localizedIn":["ru_RU"],"skuDetailsToken":"AEuhp4JqIr-pLxKHokNLJH9I-2VtCWA9PdObL9SghOvlxJbv_hl3KmexUMFBS1BFIB8o","oneTimePurchaseOfferDetails":{"priceAmountMicros":69000000,"priceCurrencyCode":"RUB","formattedPrice":"RUB 69.00"}}, productId='small_thanks', productType='inapp', title='Thanks (TEST APP)', productDetailsToken='AEuhp4JqIr-pLxKHokNLJH9I-2VtCWA9PdObL9SghOvlxJbv_hl3KmexUMFBS1BFIB8o', subscriptionOfferDetails=null}
CdvPurchase             com.test.app      D  getAvailableProducts() -> Success
CdvPurchase             com.test.app      D  getPurchases()
CdvPurchase             com.test.app      D  queryPurchases()
CdvPurchase             com.test.app      D  executeServiceRequest() -> OK
CdvPurchase             com.test.app      I  queryPurchases(INAPP) -> Elapsed time: 5ms
CdvPurchase             com.test.app      I  queryPurchases(SUBS) -> Elapsed time: 5ms
CdvPurchase             com.test.app      D  sendToListener() -> setPurchases
CdvPurchase             com.test.app      D              data -> {"purchases":[]}
EGL_emulation           com.test.app      D  app_time_stats: avg=318.08ms min=7.51ms max=1476.33ms count=5
System                  com.test.app      W  A resource failed to call release. 
chromium                com.test.app      I  [INFO:CONSOLE(50)] "PURCHASE ID: small_thanks", source: file:///android_asset/www/js/services/billing.js (50)
CdvPurchase             com.test.app      D  buy()
CdvPurchase             com.test.app      D  buy() -> setProductDetailsParamsList
CdvPurchase             com.test.app      D  initiatePurchaseFlow()
CdvPurchase             com.test.app      D  executeServiceRequest() -> OK
CdvPurchase             com.test.app      D  initiatePurchaseFlow() -> launchBillingFlow.
PluginManager           com.test.app      W  THREAD WARNING: exec() call to InAppBillingPlugin.buy blocked the main thread for 29ms. Plugin should use CordovaInterface.getThreadPool().
CordovaActivity         com.test.app      D  Paused the activity.
EGL_emulation           com.test.app      D  app_time_stats: avg=12779.93ms min=12779.93ms max=12779.93ms count=1
Parcel                  com.test.app      W  Expecting binder but got null!
FA                      com.test.app      I  Application backgrounded at: timestamp_millis: 1701091164016
Compatibil...geReporter com.test.app      D  Compat change id reported: 78294732; UID 10162; state: ENABLED
CdvPurchase             com.test.app      D  onPurchasesUpdated() -> Success
CdvPurchase             com.test.app      D  sendToListener() -> purchasesUpdated
CdvPurchase             com.test.app      D              data -> {"purchases":[{"orderId":"GPA.3375-3842-8818-60936","packageName":"com.test.app","productId":"small_thanks","purchaseTime":1701091208616,"purchaseState":0,"purchaseToken":"dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA","quantity":1,"acknowledged":false,"productIds":["small_thanks"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"LcTyEeZEa+wuIxox4IXB6mJip5YSH3hFjVAGLuY3FdSthYg9VVM\/U9fFUs7fHnd3iB7PiizeP51QLJV6RdogyXPTFVlfzAf93nJAec1kHFlhldvhuLjc6skfJ4spRyVNr67FEckWo8FZjVwS0NNg3VZzFbdM3I\/CEzurJ6W0zFz0ycnKMtTWtTzZIKwZxDYxEU6UU5lwWejlDSBsttdK0Tu\/p9gxyIpCRP7Yor1QjnBqCb9UrXsSUdua4X7ZTv4nOQbHQFpq2vs\/y4VmHedJsSKAaAFRMoco72LAJf2rPsR0Or4kX1s739C+yk1iKhbERpETfsRwvBlse7oKckCGbw==","receipt":"{\"orderId\":\"GPA.3375-3842-8818-60936\",\"packageName\":\"com.test.app\",\"productId\":\"small_thanks\",\"purchaseTime\":1701091208616,\"purchaseState\":0,\"purchaseToken\":\"dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA\",\"quantity\":1,\"acknowledged\":false}"}]}
CordovaActivity         com.test.app      D  Resumed the activity.
chromium                com.test.app      I  [INFO:CONSOLE(53)] "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'code')", source: file:///android_asset/www/js/services/billing.js (53)
chromium                com.test.app      I  [INFO:CONSOLE(57)] "PURCHASE APPROVED GPA.3375-3842-8818-60936", source: file:///android_asset/www/js/services/billing.js (57)
chromium                com.test.app      I  [INFO:CONSOLE(62)] "PURCHASE VERIFIED GPA.3375-3842-8818-60936", source: file:///android_asset/www/js/services/billing.js (62)
CdvPurchase             com.test.app      D  consumePurchase(dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA)
CdvPurchase             com.test.app      D  executeServiceRequest() -> OK
CdvPurchase             com.test.app      D  onConsumeResponse()
CdvPurchase             com.test.app      D  onConsumeResponse() -> Success
CdvPurchase             com.test.app      D  sendToListener() -> purchaseConsumed
CdvPurchase             com.test.app      D              data -> {"purchase":{"orderId":"GPA.3375-3842-8818-60936","packageName":"com.test.app","productId":"small_thanks","purchaseTime":1701091208616,"purchaseState":0,"purchaseToken":"dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA","quantity":1,"acknowledged":false,"productIds":["small_thanks"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"LcTyEeZEa+wuIxox4IXB6mJip5YSH3hFjVAGLuY3FdSthYg9VVM\/U9fFUs7fHnd3iB7PiizeP51QLJV6RdogyXPTFVlfzAf93nJAec1kHFlhldvhuLjc6skfJ4spRyVNr67FEckWo8FZjVwS0NNg3VZzFbdM3I\/CEzurJ6W0zFz0ycnKMtTWtTzZIKwZxDYxEU6UU5lwWejlDSBsttdK0Tu\/p9gxyIpCRP7Yor1QjnBqCb9UrXsSUdua4X7ZTv4nOQbHQFpq2vs\/y4VmHedJsSKAaAFRMoco72LAJf2rPsR0Or4kX1s739C+yk1iKhbERpETfsRwvBlse7oKckCGbw==","receipt":"{\"orderId\":\"GPA.3375-3842-8818-60936\",\"packageName\":\"com.test.app\",\"productId\":\"small_thanks\",\"purchaseTime\":1701091208616,\"purchaseState\":0,\"purchaseToken\":\"dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA\",\"quantity\":1,\"acknowledged\":false}"}}
chromium                com.test.app      I  [INFO:CONSOLE(57)] "PURCHASE APPROVED GPA.3375-3842-8818-60936", source: file:///android_asset/www/js/services/billing.js (57)
chromium                com.test.app      I  [INFO:CONSOLE(70)] "PURCHASE FINISHED GPA.3375-3842-8818-60936", source: file:///android_asset/www/js/services/billing.js (70)
chromium                com.test.app      I  [INFO:CONSOLE(594)] "small_thanks SUCCESS CUNSUMED", source: file:///android_asset/www/js/app.js (594)
chromium                com.test.app      I  [INFO:CONSOLE(595)] "{"className":"Transaction","transactionId":"GPA.3375-3842-8818-60936","state":"finished","products":[{"id":"small_thanks"}],"platform":"android-playstore","nativePurchase":{"orderId":"GPA.3375-3842-8818-60936","packageName":"com.test.app","productId":"small_thanks","purchaseTime":1701091208616,"purchaseState":0,"purchaseToken":"dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA","quantity":1,"acknowledged":true,"productIds":["small_thanks"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"LcTyEeZEa+wuIxox4IXB6mJip5YSH3hFjVAGLuY3FdSthYg9VVM/U9fFUs7fHnd3iB7PiizeP51QLJV6RdogyXPTFVlfzAf93nJAec1kHFlhldvhuLjc6skfJ4spRyVNr67FEckWo8FZjVwS0NNg3VZzFbdM3I/CEzurJ6W0zFz0ycnKMtTWtTzZIKwZxDYxEU6UU5lwWejlDSBsttdK0Tu/p9gxyIpCRP7Yor1QjnBqCb9UrXsSUdua4X7ZTv4nOQbHQFpq2vs/y4VmHedJsSKAaAFRMoco72LAJf2rPsR0Or4kX1s739C+yk1iKhbERpETfsRwvBlse7oKckCGbw==","receipt":"{\"orderId\":\"GPA.3375-3842-8818-60936\",\"packageName\":\"com.test.app\",\"productId\":\"small_thanks\",\"purchaseTime\":1701091208616,\"purchaseState\":0,\"purchaseToken\":\"dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA\",\"quantity\":1,\"acknowledged\":false}"},"purchaseId":"dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA","purchaseDate":"2023-11-27T13:20:08.616Z","isPending":false,"isAcknowledged":true,"renewalIntent":"Lapse"}", source: file:///android_asset/www/js/app.js (595)
EGL_emulation           com.test.app      D  app_time_stats: avg=1424.03ms min=4.26ms max=8460.06ms count=6
chromium                com.test.app      I  [INFO:CONSOLE(62)] "PURCHASE VERIFIED GPA.3375-3842-8818-60936", source: file:///android_asset/www/js/services/billing.js (62)
CdvPurchase             com.test.app      D  consumePurchase(dlfcfpgpokpklajfiapklnpb.AO-J1Ox_6X6jf7EEY8PKBaYK3XNr627dH9Ks1yoJAyU2YS3gv9RLxICOos0RvnW_K5v7mL3Se80Oj4EK_Xgo8Elx8TJXvImrgxaQsGwsV2UPTdmQQk5NNmA)
CdvPurchase             com.test.app      D  executeServiceRequest() -> OK
BillingClient           com.test.app      W  Error consuming purchase with token. Response code: 8
CdvPurchase             com.test.app      D  onConsumeResponse()
CdvPurchase             com.test.app      D  Item is not owned by the user.
CdvPurchase             com.test.app      D  callError({code:6777013, msg:"Item is not owned by the user.")
chromium                com.test.app      I  [INFO:CONSOLE(50)] "PURCHASE ID: small_thanks", source: file:///android_asset/www/js/services/billing.js (50)
CdvPurchase             com.test.app      D  buy()
CdvPurchase             com.test.app      D  buy() -> setProductDetailsParamsList
CdvPurchase             com.test.app      D  initiatePurchaseFlow()
CdvPurchase             com.test.app      D  executeServiceRequest() -> OK
CdvPurchase             com.test.app      D  initiatePurchaseFlow() -> launchBillingFlow.
CdvPurchase             com.test.app      D  onActivityResult(-1,0,null)
CdvPurchase             com.test.app      D  onActivityResult() -> super.onActivityResult()
PluginManager           com.test.app      W  THREAD WARNING: exec() call to InAppBillingPlugin.buy blocked the main thread for 21ms. Plugin should use CordovaInterface.getThreadPool().
CordovaActivity         com.test.app      D  Paused the activity.
Parcel                  com.test.app      W  Expecting binder but got null!
EGL_emulation           com.test.app      D  app_time_stats: avg=2912.47ms min=2912.47ms max=2912.47ms count=1
FA                      com.test.app      I  Application backgrounded at: timestamp_millis: 1701091175519
CdvPurchase             com.test.app      D  onPurchasesUpdated() -> Success
CdvPurchase             com.test.app      D  sendToListener() -> purchasesUpdated
CdvPurchase             com.test.app      D              data -> {"purchases":[{"orderId":"GPA.3363-3513-5722-90846","packageName":"com.test.app","productId":"small_thanks","purchaseTime":1701091219924,"purchaseState":0,"purchaseToken":"jkmlaehcgldncajolikbklcg.AO-J1Ow_1RoJZaFFc8O9R36Az13RidUp0LpUjTspoQ8xB7N75eMmS0nt9c7pJI1SAfdtI4o77m_mnl0i5u7hae1oF5TJWCLkqC028rLOH66oRqyqAsVYw7k","quantity":1,"acknowledged":false,"productIds":["small_thanks"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"WNz7VzaKqiU8zEZliEhEvPdLofvRGkh8w9qHmHca2GXE8wBKoeucMkSkYP4Ce\/DqcVnOLBMj2ctAZOHsdiwFS0jl69SsBwHvnw1ryMF1nUpcHMSr5OB6lTyWmKndpNn6Ou9AXmc+GtT5ZB+E5\/RrDJ6c1xbXKwenBqAv4SgmdqQjfttFODTQlNm2ziqkfX+0Qfsfwp+zYmvOc85wM4UAQ\/+SjTLypkuK189mEIuRoH2Up7\/NHC1a3LauGrwLOgoNWMCviisfUXUXbB1nyfYBCxCF2yjEAdrbdSNRZ8hcFw6\/VLwQOaQk0zw4A5FlCRMusWxJuz2+XjOuCUPsME3puQ==","receipt":"{\"orderId\":\"GPA.3363-3513-5722-90846\",\"packageName\":\"com.test.app\",\"productId\":\"small_thanks\",\"purchaseTime\":1701091219924,\"purchaseState\":0,\"purchaseToken\":\"jkmlaehcgldncajolikbklcg.AO-J1Ow_1RoJZaFFc8O9R36Az13RidUp0LpUjTspoQ8xB7N75eMmS0nt9c7pJI1SAfdtI4o77m_mnl0i5u7hae1oF5TJWCLkqC028rLOH66oRqyqAsVYw7k\",\"quantity\":1,\"acknowledged\":false}"}]}
CordovaActivity         com.test.app      D  Resumed the activity.
chromium                com.test.app      I  [INFO:CONSOLE(53)] "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'code')", source: file:///android_asset/www/js/services/billing.js (53)
chromium                com.test.app      I  [INFO:CONSOLE(57)] "PURCHASE APPROVED GPA.3363-3513-5722-90846", source: file:///android_asset/www/js/services/billing.js (57)
chromium                com.test.app      I  [INFO:CONSOLE(57)] "PURCHASE APPROVED GPA.3363-3513-5722-90846", source: file:///android_asset/www/js/services/billing.js (57)
EGL_emulation           com.test.app      D  app_time_stats: avg=606.75ms min=2.57ms max=6617.30ms count=11
chromium                com.test.app      I  [INFO:CONSOLE(62)] "PURCHASE VERIFIED GPA.3363-3513-5722-90846", source: file:///android_asset/www/js/services/billing.js (62)
CdvPurchase             com.test.app      D  consumePurchase(jkmlaehcgldncajolikbklcg.AO-J1Ow_1RoJZaFFc8O9R36Az13RidUp0LpUjTspoQ8xB7N75eMmS0nt9c7pJI1SAfdtI4o77m_mnl0i5u7hae1oF5TJWCLkqC028rLOH66oRqyqAsVYw7k)
CdvPurchase             com.test.app      D  executeServiceRequest() -> OK
chromium                com.test.app      I  [INFO:CONSOLE(62)] "PURCHASE VERIFIED GPA.3363-3513-5722-90846", source: file:///android_asset/www/js/services/billing.js (62)
CdvPurchase             com.test.app      D  consumePurchase(jkmlaehcgldncajolikbklcg.AO-J1Ow_1RoJZaFFc8O9R36Az13RidUp0LpUjTspoQ8xB7N75eMmS0nt9c7pJI1SAfdtI4o77m_mnl0i5u7hae1oF5TJWCLkqC028rLOH66oRqyqAsVYw7k)
CdvPurchase             com.test.app      I  consumePurchase() -> Consume already in progress.
CdvPurchase             com.test.app      D  callError({code:6777003, msg:"ITEM_ALREADY_CONSUMED")
CdvPurchase             com.test.app      D  onConsumeResponse()
CdvPurchase             com.test.app      D  onConsumeResponse() -> Success
CdvPurchase             com.test.app      D  sendToListener() -> purchaseConsumed
CdvPurchase             com.test.app      D              data -> {"purchase":{"orderId":"GPA.3363-3513-5722-90846","packageName":"com.test.app","productId":"small_thanks","purchaseTime":1701091219924,"purchaseState":0,"purchaseToken":"jkmlaehcgldncajolikbklcg.AO-J1Ow_1RoJZaFFc8O9R36Az13RidUp0LpUjTspoQ8xB7N75eMmS0nt9c7pJI1SAfdtI4o77m_mnl0i5u7hae1oF5TJWCLkqC028rLOH66oRqyqAsVYw7k","quantity":1,"acknowledged":false,"productIds":["small_thanks"],"getPurchaseState":1,"developerPayload":"","autoRenewing":false,"accountId":"","profileId":"","signature":"WNz7VzaKqiU8zEZliEhEvPdLofvRGkh8w9qHmHca2GXE8wBKoeucMkSkYP4Ce\/DqcVnOLBMj2ctAZOHsdiwFS0jl69SsBwHvnw1ryMF1nUpcHMSr5OB6lTyWmKndpNn6Ou9AXmc+GtT5ZB+E5\/RrDJ6c1xbXKwenBqAv4SgmdqQjfttFODTQlNm2ziqkfX+0Qfsfwp+zYmvOc85wM4UAQ\/+SjTLypkuK189mEIuRoH2Up7\/NHC1a3LauGrwLOgoNWMCviisfUXUXbB1nyfYBCxCF2yjEAdrbdSNRZ8hcFw6\/VLwQOaQk0zw4A5FlCRMusWxJuz2+XjOuCUPsME3puQ==","receipt":"{\"orderId\":\"GPA.3363-3513-5722-90846\",\"packageName\":\"com.test.app\",\"productId\":\"small_thanks\",\"purchaseTime\":1701091219924,\"purchaseState\":0,\"purchaseToken\":\"jkmlaehcgldncajolikbklcg.AO-J1Ow_1RoJZaFFc8O9R36Az13RidUp0LpUjTspoQ8xB7N75eMmS0nt9c7pJI1SAfdtI4o77m_mnl0i5u7hae1oF5TJWCLkqC028rLOH66oRqyqAsVYw7k\",\"quantity\":1,\"acknowledged\":false}"}}
chromium                com.test.app      I  [INFO:CONSOLE(57)] "PURCHASE APPROVED GPA.3363-3513-5722-90846", source: file:///android_asset/www/js/services/billing.js (57)
chromium                com.test.app      I  [INFO:CONSOLE(57)] "PURCHASE APPROVED GPA.3363-3513-5722-90846", source: file:///android_asset/www/js/services/billing.js (57)
chromium                com.test.app      I  [INFO:CONSOLE(62)] "PURCHASE VERIFIED GPA.3363-3513-5722-90846", source: file:///android_asset/www/js/services/billing.js (62)
CdvPurchase             com.test.app      D  consumePurchase(jkmlaehcgldncajolikbklcg.AO-J1Ow_1RoJZaFFc8O9R36Az13RidUp0LpUjTspoQ8xB7N75eMmS0nt9c7pJI1SAfdtI4o77m_mnl0i5u7hae1oF5TJWCLkqC028rLOH66oRqyqAsVYw7k)
CdvPurchase             com.test.app      D  executeServiceRequest() -> OK
chromium                com.test.app      I  [INFO:CONSOLE(62)] "PURCHASE VERIFIED GPA.3363-3513-5722-90846", source: file:///android_asset/www/js/services/billing.js (62)
CdvPurchase             com.test.app      D  consumePurchase(jkmlaehcgldncajolikbklcg.AO-J1Ow_1RoJZaFFc8O9R36Az13RidUp0LpUjTspoQ8xB7N75eMmS0nt9c7pJI1SAfdtI4o77m_mnl0i5u7hae1oF5TJWCLkqC028rLOH66oRqyqAsVYw7k)
CdvPurchase             com.test.app      I  consumePurchase() -> Consume already in progress.
CdvPurchase             com.test.app      D  callError({code:6777003, msg:"ITEM_ALREADY_CONSUMED")
BillingClient           com.test.app      W  Error consuming purchase with token. Response code: 8
CdvPurchase             com.test.app      D  onConsumeResponse()
CdvPurchase             com.test.app      D  Item is not owned by the user.
CdvPurchase             com.test.app      D  callError({code:6777013, msg:"Item is not owned by the user.")