src/ShopifyApp/Traits/BillingControllerTrait.php
public function process(Plan $plan)
    {
        // Activate the plan and save
        $shop = ShopifyApp::shop();
        $bp = new BillingPlan($shop, $plan);
        $bp->setChargeId(Request::query('charge_id'));
        $bp->activate();
        $bp->save();

        // All good, update the shop's plan and take them off freemium (if applicable)
        $shop->update([
            'freemium' => false,
            'plan_id'  => $plan->id,
        ]);

        // Go to homepage of app
        return Redirect::route('home')->with('success', 'billing');
    }
public function process(Plan $plan)
    {
        // Activate the plan and save
        $shop = ShopifyApp::shop();
        $bp = new BillingPlan($shop, $plan);
        $bp->setChargeId(Request::query('charge_id'));
        $bp->activate();
        $bp->save();

        // All good, update the shop's plan and take them off freemium (if applicable)
        $shop->update([
            'freemium' => false,
            'plan_id'  => $plan->id,
        ]);

        // Go to homepage of app
        return Redirect::route('home')->with('success', 'billing');
    }
Processes the response from the customer.

@param \OhMyBrew\ShopifyApp\Models\Plan $plan The plan.

@return \Illuminate\Http\RedirectResponse