diff --git a/src/Resources/app/administration/src/module/sw-in-app-purchases/component/sw-in-app-purchase-checkout/index.ts b/src/Resources/app/administration/src/module/sw-in-app-purchases/component/sw-in-app-purchase-checkout/index.ts index a4a84f4..04b190d 100644 --- a/src/Resources/app/administration/src/module/sw-in-app-purchases/component/sw-in-app-purchase-checkout/index.ts +++ b/src/Resources/app/administration/src/module/sw-in-app-purchases/component/sw-in-app-purchase-checkout/index.ts @@ -6,6 +6,10 @@ interface ErrorResponse { errors: Array; } +interface StoreExtension { + name: string; +} + export default Shopware.Component.wrapComponentConfig({ template, @@ -24,11 +28,17 @@ export default Shopware.Component.wrapComponentConfig({ inAppPurchaseCart: null as IAP.InAppPurchaseCart | null, extension: null as IAP.Extension | null, tosAccepted: false, - errorSnippet: null as string | null + errorSnippet: null as string | null, + storeExtension: '' as string }; }, created() { + // @deprecated tag:v4.0.0 - Will be removed as this.store.extension will be only a string in shopware 6.7 + const extension = this.store.extension as StoreExtension | string; + this.storeExtension = typeof extension === 'object' + ? extension.name + : extension; this.createdComponent(); }, @@ -73,10 +83,10 @@ export default Shopware.Component.wrapComponentConfig({ await Promise.all([ this.cart = this.inAppPurchasesService.createCart( - this.store.extension, + this.storeExtension, this.store.entry.identifier ), - this.inAppPurchasesService.getExtension(this.store.extension) + this.inAppPurchasesService.getExtension(this.storeExtension) ]).then(([inAppPurchaseCart, extension]) => { this.inAppPurchaseCart = inAppPurchaseCart; this.extension = extension;