-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fullpage_redirect_to not working in embedded app (App Bridge 2.0) #1387
Comments
I can confirm. I have the exact same error. |
@bgmat I confirm you are right. Rolling back 18.1.1 fixes the issue. Thank you! |
+1, I got the same issue. Temporarily solutions:
|
I think the changes in PR #1360 would also help fix this, as it ensures the |
Currently, I think the |
The host is pulled from Since the redirect view already has access to |
I have same error from 19.0.1 |
Since Shopify now requires all apps to be on v18.1.2 or higher, here's my approach hoping it will help the rest of you guys deal with the upgrade. The key is to make sure you pass in + const { host } = AppConfig;
const isOverLimit = imagesCount > imagesLimit;
const title = isOverLimit ? "Please upgrade your plan now" : "You're currently on the free plan";
@@ -53,7 +54,7 @@ const UsageBanner: FunctionComponent<Props> = ({ planStats, fetchPlanStats }) =>
<Banner title={title} status={status}>
<TextContainer>
{message()}
- <Button outline download url="/upgrade">
+ <Button outline download url={`/upgrade?host=${host}`}>
{`Upgrade for $${proPlanPrice}/mo.`}
</Button>
</TextContainer> My app is an SPA which receives the class AdminController < ShopifyApp::AuthenticatedController
# ...
before_action :set_host
private
def set_host
@host = params[:host]
end
end so it can be exposed to the frontend and passed into any redirect (as shown above). For completeness I made the following changes to the charges controller: class ChargesController < AdminController
def upgrade
- charge = ChargesFactory.new_charge
+ charge = ChargesFactory.new_charge(@host)
fullpage_redirect_to charge.confirmation_url if charge.save
end
def activate
MailchimpEventsWorker.perform_async(@shop.id)
@shop.update(current_charge: true)
- fullpage_redirect_to root_url
+ redirect_to "#{root_url}?host=#{@host}&upgraded=true"
end And my charges factory: module ChargesFactory
module_function
- DEFAULTS = {
- return_url: "#{ENV.fetch('HOST')}/activate_charge",
- }.freeze
-
- def new_charge
+ def new_charge(host)
charge_options = {
name: 'PRO plan. Big love!',
price: Shop::PRO_PLAN_PRICE,
+ return_url: "#{ENV.fetch('HOST')}/activate_charge?host=#{host}",
}
- ShopifyAPI::RecurringApplicationCharge.new(DEFAULTS.merge(charge_options))
+ ShopifyAPI::RecurringApplicationCharge.new(charge_options)
end
end This way the |
This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days. |
We are closing this issue because it has been inactive for a few months. If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines Thank you! |
We have recently updated our version of this gem to v18.1.2 due to the App Bridge 2.0 related deprecation messages from Shopify.
When a user attempts to upgrade their plan, we create a new RecurringApplicationCharge and fire off a
fullpage_redirect_to
to the RecurringApplicationCharge'sconfirmation_url
. In the browser we see the following:Any help would be appreciated.
The text was updated successfully, but these errors were encountered: