j3k0 / cordova-plugin-purchase

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

iOS Unable to complete a consumable product purchase #1498

Open ElainaRichard opened 6 months ago

ElainaRichard commented 6 months ago

Observed behavior

iOS only. This works for us on Android just fine. When testing (using the sandbox) purchasing a consumable product set up in our AppStoreConnect account (product id = 14), an error is thrown by the plugin before the "approved()" callback is reached. The native iOS in app purchase popover displays with the product and the price. I allow the purchase. I receive a popup that says the purchase was successful along with a note that verifies "[Environment: Sandbox]". However, the store.approved() callback is never reached due to the following error being thrown in the console:

TypeError: undefined is not an object (evaluating 'window.storekit.updatedTransactionCallback.apply')
(anonymous function) — courses:7
(anonymous function) — user-script:13:1133
(anonymous function) — user-script:13:1157
Global Code — courses:4

Include logs with store.verbosity = store.DEBUG

[Log] onscript loading complete (user-script:13, line 1456) [Log] native App.addListener (#104276706) (user-script:2, line 291) [Log] {callbackId: "104276706", pluginId: "App", methodName: "addListener", options: {eventName: "appUrlOpen"}}ObjectcallbackId: "104276706"methodName: "addListener"options: {eventName: "appUrlOpen"}ObjectpluginId: "App"type: "message"Object Prototype (user-script:2, line 298) [Log] Create CdvPurchase... (user-script:15, line 1934) [Log] Create CdvPurchase... (chunk-vendors.f9ee8212.js, line 158) [Log] Object (user-script:2, line 298)

callbackId: "104276707"

methodName: "addListener"

options: {eventName: "backButton"}

pluginId: "App"

type: "message"

Object Prototype [Log] [CdvPurchase] INFO: initialize() (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Adapters] INFO: Adding platforms: [{"platform":"ios-appstore"}] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Adapters] INFO: (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Adapters] INFO: AppStore initializing... (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: bridge.init (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: setup ok (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: ready (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: bridge.init done (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Adapters] INFO: AppStore initialized. (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Adapters] INFO: AppStore products: [{"id":"88","type":"consumable","platform":"ios-appstore"},{"id":"81","type":"consumable","platform":"ios-appstore"},{"id":"58","type":"consumable","platform":"ios-appstore"},{"id":"87","type":"consumable","platform":"ios-appstore"},{"id":"91","type":"consumable","platform":"ios-appstore"},{"id":"92","type":"consumable","platform":"ios-appstore"},{"id":"96","type":"consumable","platform":"ios-appstore"},{"id":"14","type":"consumable","platform":"ios-appstore"},{"id":"93","type":"consumable","platform":"ios-appstore"},{"id":"90","type":"consumable","platform":"ios-appstore"},{"id":"72","type":"consumable","platform":"ios-appstore"},{"id":"99","type":"consumable","platform":"ios-appstore"},{"id":"98","type":"consumable","platform":"ios-appstore"},{"id":"100","type":"consumable","platform":"ios-appstore"},{"id":"94","type":"consumable","platform":"ios-appstore"},{"id":"77","type":"consumable","platform":"ios-appstore"}] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: bridge.load (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: load ["88","81","58","87","91","92","96","14","93","90","72","99","98","100","94","77"] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: load ok: { valid:[{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null}] invalid:["99","90","91","58","96","81","92","87","93","72","98","77","100","94","88"] } (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: bridge.loaded: {"validProducts":[{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null}],"invalidProducts":["99","90","91","58","96","81","92","87","93","72","98","77","100","94","88"]} (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: load eligibility: [{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null}] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: No discount eligibility determiner, skipping... (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: eligibilities ready: {"request":[],"response":[]} (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 88 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 81 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 58 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 87 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 91 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 92 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 96 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 14 is valid: {"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null} (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: registering new product (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 93 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 90 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 72 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 99 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 98 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 100 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 94 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 77 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: Products loaded: [{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"88"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"81"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"58"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"87"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"91"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"92"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"96"},{"className":"Product","title":"School Nurse General Education","description":"School Nurses: Improve clinical knowledge","platform":"ios-appstore","type":"consumable","id":"14","offers":[{"className":"Offer","id":"$","pricingPhases":[{"price":"$29.99","priceMicros":29990000,"currency":"USD","paymentMode":"UpFront","recurrenceMode":"NON_RECURRING"}],"productId":"14","productType":"consumable","platform":"ios-appstore","offerType":"Default"}],"raw":{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null},"countryCode":"US"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"93"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"90"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"72"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"99"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"98"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"100"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"94"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"77"}] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: processing pending transactions (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: loading appstore receipt... (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: loading appStoreReceipt (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: infoPlist: com.medobby.lrn,1.3.0,33587200,null (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: appstore receipt loaded (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AdapterListener] DEBUG: receiptsReady: ios-appstore (1/0) (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Adapters] INFO: AppStore products loaded: [{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"88"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"81"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"58"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"87"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"91"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"92"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"96"},{"className":"Product","title":"School Nurse General Education","description":"School Nurses: Improve clinical knowledge","platform":"ios-appstore","type":"consumable","id":"14","offers":[{"className":"Offer","id":"$","pricingPhases":[{"price":"$29.99","priceMicros":29990000,"currency":"USD","paymentMode":"UpFront","recurrenceMode":"NON_RECURRING"}],"productId":"14","productType":"consumable","platform":"ios-appstore","offerType":"Default"}],"raw":{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null},"countryCode":"US"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"93"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"90"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"72"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"99"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"98"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"100"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"94"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"77"}] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Adapters] INFO: AppStore receipts loaded: [{"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"appstore.application","state":"approved","products":[{"id":"com.medobby.lrn"}],"platform":"ios-appstore"}],"platform":"ios-appstore","nativeData":{"appStoreReceipt":"[bunch of stuff]","bundleIdentifier":"com.medobby.lrn","bundleShortVersion":"1.3.0","bundleNumericVersion":33587200,"bundleSignature":null}},{"className":"Receipt","transactions":[],"platform":"ios-appstore"}] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AdapterListener] DEBUG: setSupportedPlatforms: ios-appstore (1 have their receipts ready) (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AdapterListener] DEBUG: triggering receiptsReady() (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] INFO: update() (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: bridge.load (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: load ["88","81","58","87","91","92","96","14","93","90","72","99","98","100","94","77"] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] DEBUG: Calling callback: type=receiptsReady() name=#b4bec88d7586367df9a88c46355b44ce (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.ReceiptsMonitor] DEBUG: receiptsReady... (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.ReceiptsMonitor] DEBUG: check(0/0) (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.ReceiptsMonitor] INFO: receiptsVerified() (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: load ok: { valid:[{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null}] invalid:["99","90","91","58","96","81","92","87","93","72","98","77","100","94","88"] } (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: bridge.loaded: {"validProducts":[{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null}],"invalidProducts":["99","90","91","58","96","81","92","87","93","72","98","77","100","94","88"]} (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: load eligibility: [{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null}] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: No discount eligibility determiner, skipping... (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: eligibilities ready: {"request":[],"response":[]} (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 88 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 81 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 58 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 87 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 91 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 92 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 96 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 14 is valid: {"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null} (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: refreshing existing product (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 93 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 90 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 72 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 99 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 98 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 100 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 94 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: 77 is invalid (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: Products loaded: [{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"88"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"81"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"58"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"87"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"91"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"92"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"96"},{"className":"Product","title":"School Nurse General Education","description":"School Nurses: Improve clinical knowledge","platform":"ios-appstore","type":"consumable","id":"14","offers":[{"className":"Offer","id":"$","pricingPhases":[{"price":"$29.99","priceMicros":29990000,"currency":"USD","paymentMode":"UpFront","recurrenceMode":"NON_RECURRING"}],"productId":"14","productType":"consumable","platform":"ios-appstore","offerType":"Default"}],"raw":{"id":"14","description":"School Nurses: Improve clinical knowledge","introPrice":null,"introPricePaymentMode":null,"billingPeriodUnit":"Day","countryCode":"US","introPricePeriodUnit":null,"discounts":[],"title":"School Nurse General Education","price":"$29.99","billingPeriod":0,"group":null,"priceMicros":29990000,"currency":"USD","introPricePeriod":null,"introPriceMicros":null},"countryCode":"US"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"93"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"90"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"72"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"99"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"98"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"100"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"94"},{"isError":true,"code":6777012,"message":"Product not found in AppStore. #400","platform":"ios-appstore","productId":"77"}] (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] DEBUG: receipt updated and ready. (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AdapterListener] DEBUG: receiptsReady: ios-appstore(skipping) (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] DEBUG: Calling callback: type=approved() name=#18aebae6a6f7a87f485dee1862952505 (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] DEBUG: Calling callback: type=approved() name=#ff442d1a5166b4f69b797df6118ea663 (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] INFO: verify(Transaction) (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Validator] DEBUG: Schedule validation: {"className":"Transaction","transactionId":"appstore.application","state":"approved","products":[{"id":"com.medobby.lrn"}],"platform":"ios-appstore"} (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Validator] DEBUG: Validation requests=1 responses=0 (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: restoreCompleted (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: refreshing appStoreReceipt (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Validator] DEBUG: Validation requests=1 responses=1 (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Validator] DEBUG: Validation requests=1 responses=2 (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.Validator] DEBUG: Register a new verified receipt. (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] DEBUG: Calling callback: type=verified() name=#8cee8600129d146535c8336781eb9507 (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] INFO: finish(VerifiedReceipt) (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: finish(appstore.application) (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] DEBUG: Calling callback: type=finished() name=#18aebae6a6f7a87f485dee1862952505 (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore.Bridge] DEBUG: infoPlist: com.medobby.lrn,1.3.0,33587200,null (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: receiptsRefreshed (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase] INFO: order(14) (chunk-vendors.f9ee8212.js, line 158) [Log] [CdvPurchase.AppleAppStore] INFO: order (chunk-vendors.f9ee8212.js, line 158) [Log] TypeError: undefined is not an object (evaluating 'window.storekit.updatedTransactionCallback.apply') — courses:7 (user-script:13, line 1135)

Expected behavior

I should be able to perform actions in the approved() callback so that I can verify and finalize the purchase.

System Info

cordova-plugin-purchase: 13.9.0 and 13.8.2 (tried both)

Ionic: Ionic CLI : 6.16.3 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/vue 6.7.5

Capacitor: Capacitor CLI : 5.2.3 @capacitor/android : 5.2.3 @capacitor/core : 5.2.3 @capacitor/ios : 5.2.3

Utility: cordova-res: not installed globally native-run (update available: 2.0.0) : 1.7.2

System: NodeJS : v20.6.1 (/usr/local/bin/node) npm : 9.8.1 OS : macOS

iOS device: iOS 16.7.2

XCode: 15.0.1

MacOS Sonoma 14.1.1

andreassh commented 5 months ago

I'm having the same issue. Android works fine iOS produces above error. Was working fine on earlier versions

AlexandrDegteari commented 5 months ago

I'm having the same issue. Android works fine iOS produces above error. Was working fine on earlier versions

Which version exactly works?

andreassh commented 5 months ago

I'm having the same issue. Android works fine iOS produces above error. Was working fine on earlier versions

Which version exactly works?

Found the issue. Nothing to do with this plugin. My bad. My account holder hadn't accepted the latest "Paid Application" aggrement, resulting in the "Product not found in AppStore" error.