Usage Charges Redirecting to Blank Page
koraysari opened this issue · 5 comments
https://github.com/Kyon147/laravel-shopify/wiki/Creating-a-Billable-App#creating-usage-charges
I followed the instructions provided in the "Creating Usage Charges" section of the Laravel Shopify package documentation to create a usage charge for my app
Expected Behavior
When trying to create usage charges for a shop that is on a recurring plan with usage charge abilities, I expect to be directed to a payment confirmation page where the shop can approve the charge.
Current Behavior
Instead of being redirected to a payment page, the process redirects to an empty page, and no interaction with a payment or approval interface occurs. However, the charge seems to be stored in the database as if it had been approved.
Context
- Package Version: v20.0.0
- Laravel Version: v8.83.27
- PHP Version: v8.1
- Template Engine: Blade
Failure Logs
$usageChargeRoute = route('billing.usage_charge', array_merge($charge, ['signature' => $signature->toNative()]));
usageChargeRoute URL attempted for usage charges: https://feedimize.fullyfeed.com/billing/usage-charge?description=$1%20per%20additional%201%2C000%20products&price=1&redirect=https%3A%2F%2Ffeedimize.fullyfeed.com&signature=a45c16e3a15e8326e4d6dee7812339e4f7f9cc966c417face1256d26dd52d885&shop=fully-feed.myshopify.com
You are using the route()
method but you need to make sure you pass the host
param along with every request.
If you look in your console you'll likely see an error with app bridge missing the host param.
Please read the wiki for more https://github.com/Kyon147/laravel-shopify/wiki/Authentication-Process
Closing as inactive, re-open if you still have an issue.
Based on the documentation's recommendations, I utilized the URL::tokenRoute method to construct the usage charge link. The host parameter is now included in the URL. The newly generated link was as follows:
Unfortunately, even after implementing the usage charge link via the URL::tokenRoute, the issue persisted, leading to the same outcome of being redirected to a blank page without any visible error messages in the console.
It looks like your redirect string is not right as some is encoded and some is not, mainly the host
and shop
param.
How are you building it?
Closing stale ticket, reopen if issue still happens