Skip to content

Redirecting Users to Billing Confirmation URL in Embedded Shopify App #1005

Closed
@sanjaymakwana05

Description

@sanjaymakwana05

Hi @lizkenyon I hope you are doing well. thank for your help. and suggestion or the new issue.

Issue:

I am trying to redirect users to the billing confirmation URL using the following code:

The URL logged in is_return is correct, and it works when manually opened in a browser. However, since our app is embedded, it does not open the billing confirmation URL as expected.

P
Expected Behavior:

When a user initiates a subscription plan, they should be redirected to the billing confirmation URL within the embedded Shopify app environment.

Observed Behavior:

The redirect does not work inside the embedded app.

Steps to Reproduce:

  1. Create the shopify remix app using the CLI
  2. run the app it was working expected.
  3. add the billing plan as the document mention. I have implemented the monthly fix plus usage base. [ [Shopify help doc link ](Combine time and usage-based subscriptions)]
  4. Yes for the fixed monthly plan it was working as expected this link it working expected [].
  5. while the using the {Combine time and usage-based subscriptions} this feature us not working as expected here i have reported the issue
  6. if I am using the direct Graphql API it was not redirecting

Node js Package version
"dependencies": { "@prisma/client": "^6.3.1", "@remix-run/dev": "^2.7.1", "@remix-run/node": "^2.7.1", "@remix-run/react": "^2.7.1", "@remix-run/serve": "^2.7.1", "@shopify/app-bridge-react": "^4.1.2", "@shopify/polaris": "^12.0.0", "@shopify/shopify-app-remix": "^3.7.3", "@shopify/shopify-app-session-storage-prisma": "^6.0.1",

Trigger the subscription plan creation.

Capture the confirmationUrl.

Attempt to redirect using return redirect(is_return);.

The redirection does not occur within the embedded app.

Potential Cause:

Since the app is embedded, Shopify might block direct navigation. This may require using the App Bridge's Redirect component to handle the redirection properly.

I am trying to redirect users to the billing confirmation URL using the following code:
I am referring this Doc - https://shopify.dev/docs/apps/launch/billing/subscription-billing/combine-time-and-usage

let is_return = plan.data.appSubscriptionCreate.confirmationUrl;
console.log("is_return :- ", is_return);

return redirect(is_return);

The URL logged in is_return is correct, and it works when I manually open it in a browser. However, since our app is embedded, it does not open the billing confirmation URL as expected.

Could you please help me with a solution for handling this redirect properly in an embedded Shopify app?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions