-
-
Notifications
You must be signed in to change notification settings - Fork 377
Billable app throwing exception on install #1110
Comments
also getting the same error in php 8.1, while using billing TypeError |
@ashwin-nath-m and @folio3git - Have you enabled billing in your ENV? |
@Kyon147 yes billing is enabled in env |
From the error, you basically not passing over the ID for the plan itself I've seen this issue before, when there's no plans in the DB or incorrectly and it tries to add a plan but without 4 parameters and the 2nd param which is the Request, gets passed as the first hence the error. |
I am just going to a billable route ie my app's home route. There is already a plan in table (insert sql in description). where should i pass plan id? |
I have also encountered the same error in php 8.1 INSERT INTO plans ( insert plans as well and when I change php version to 7.4 then no error Package Version: v17.1.0 Thank you |
Trying on php 8.1.2 I do see a deprecated warning that will need fixing PHP Deprecated: However, I can get the Plan correctly - so not sure if this is the same error you are facing. Can you have a look in your laravel logs to see if there's any more details? |
This is the stacktrace . Maybe because of this? local.ERROR: Osiset\ShopifyApp\Http\Controllers\BillingController::index(): Argument #1 ($plan) must be of type ?int, Illuminate\Http\Request given, called in /var/www/app/releases/15/vendor/laravel/framework/src/Illuminate/Routing/Controller.php on line 54 {"userId":3,"exception":"[object] (TypeError(code: 0): Osiset\ShopifyApp\Http\Controllers\BillingController::index(): Argument #1 ($plan) must be of type ?int, Illuminate\Http\Request given, called in /var/www/app/releases/15/vendor/laravel/framework/src/Illuminate/Routing/Controller.php on line 54 at /var/www/app/releases/15/vendor/osiset/laravel-shopify/src/Traits/BillingController.php:37) |
@Kyon147 Thank you |
Hey @bilal186 Can you try using php@8.0 and see if the issue persists? |
I have checked with php@7.4 its working fine |
Yep same here with fresh install on PHP 8.1 |
I believe this bug is on 8.1 - can you try 8.0 and see if it works @d-shannon |
@Kyon147 yep confirming it works on 8.0. Had a job getting valet to isolate the version but got there in the end! Cheers |
So is the answer to just lower our version to 8.0? Has their been a fix for 8.1 with this bug? I am running into this issue now as well. |
Yeah I believe on PHP8.1 optional parameters must be at the end of the method, which is why this gets flagged as an issue. |
Makes sense. So doesn't that mean we should update the Osiset package? |
Hey @talktohenryj Yeah A PR with the fix needs to be done. I think i have seen another PR for another fix also tackable, of the top of my head it might be the laravel 9 PR. |
Hi @Kyon147 TypeError |
Easiest solution for now, drop to php version 8.0 not 8.1 |
@DeveloperHashmi thats what I did. I lowered my php. To do so I had to delete my vendor folder and do a composer install though. |
Hi @Kyon147 Osiset\ShopifyApp\Exceptions\ApiException Should we create a plan using shopify Recurring Application Charge API or this API can create plan automatically.If I've to create plan, Then should we pass plan id in route page with billable middleware. (SS Attached) |
Do you have your plans set up in the plans table with one of them set to have the It look like it is not passing a plan_id to the route to select the right pricing. |
Dear @Kyon147 Please reply this also. If I've to create plan, should we pass plan id in route page with billable middleware. |
As you have set id The package will create the charge automatically when you send them to a certain plan. If you have not, i recommend reading the Creating a billable app wiki page This will go through the basic setup for creating the billable routes etc. One thing to remember when selecting plans, you need to pass the plan id and the shop admin url i.e teststore.myshopify.com. It's mentioned here. |
Hi @Kyon147, Got billing/process/{id} page not found error. Please help to resolve.I implemented every thing as you said, and got billing page. But, whenever I clicked on cancel button (i.e. available on payment page - SS Attached) I didn't get payment page on the time of app installation for accepting payment terms (Plan 1, Already set to 1 on_install). |
I can confirm I get the same error, that new apps popup page is new since they moved apps to the "search" dropdown so I think the internal redirects after a cancelled charge have changed. @osiset - just flagging and will try and get a PR out for it next week when I have time. |
There is a PR out for this #1145 which we will try and ger merged. |
Hello @Kyon147 @osiset, This has been an issue (Billable app throwing an exception on install) for a while now. We urgently need your assistance, Please let me know how we may help you move the process along faster. Could you please help me with the timeline to get this done? That will be really helpful! Thank you! |
Hi @Avdkash This has been merged now into master and will be in the next release which I am working on this week hopefully. |
Hello @Kyon147 Thank you! I will be waiting for the update. |
This should be sorted now I believe in |
For bug reporting only! If you're posting a feature request or discussion, please ignore.
Expected Behavior
App installed and user billed sucesfully
Current Behavior
App gets installed but crashes at billing part with exception
Failure Information
This is the exception
TypeError
Osiset\ShopifyApp\Http\Controllers\BillingController::index(): Argument #1 ($plan) must be of type ?int, Illuminate\Http\Request given, called in /var/www/xxx/releases/15/vendor/laravel/framework/src/Illuminate/Routing/Controller.php on line 54
Steps to Reproduce
Add plans using INSERT INTO plans (
type
,name
,price
,interval
,capped_amount
,terms
,trial_days
,test
,on_install
,created_at
,updated_at
) VALUES('RECURRING','Test Plan',5.00,'EVERY_30_DAYS',10.00,'Test terms',7,TRUE,1,NULL,NULL);
Add middleware (['auth.shopify', 'billable']) to app home page route
Try installing 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.
The text was updated successfully, but these errors were encountered: