Kyon147 / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
363 stars 107 forks source link

Unable to set freemium flag on app uninstallation. #279

Closed alamriku closed 6 months ago

alamriku commented 6 months ago

Expected Behavior

$freemium = Util::getShopifyConfig('billing_freemium_enabled');
        if ($freemium=== true) {
            // Add the freemium flag to the shop
            $shopCommand->setAsFreemium($shopId);
        }

If billing_freemium_enabled is true, but the Freemium flag is not set, the condition is not working properly.

Current Behavior

if condition is always false for billing_freemium_enabled

Failure Information

Assigning the billing_freemium_enabled value to variable $freemium causing the issue. If we use the below code

if (Util::getShopifyConfig('billing_freemium_enabled') === true) {
            // Add the freemium flag to the shop
            $shopCommand->setAsFreemium($shopId);
        }

then it is working. I have found that we are using same type of condition check on Billable middleware

if (Util::getShopifyConfig('billing_enabled') === true) { }

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. install the shopify app then
  2. uninstall the app

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

Please include any relevant log snippets or files here.

Kyon147 commented 6 months ago

@alamriku you have a type, you are missing a $ for your if statement - it should be like this but not tested it.

$freemium = Util::getShopifyConfig('billing_freemium_enabled');
        if ($freemium=== true) {
            // Add the freemium flag to the shop
            $shopCommand->setAsFreemium($shopId);
        }

This does not look like an issue with the package, so going to close this issue but if you can provide more information on it being one, we can re-open.

alamriku commented 6 months ago

Sorry my mistake. I have missed the dollar sign on the description. The issue related with package. I have created a PR 280