Hello! We are using Managed App Pricing for our public app and we have only 3plans. Is it possible to navigate to approve charge page upon app installation? Just a note - our app was built in Remix template.
I am using this code
await billing.require({
plans:[], // I dont know how to get the plans here ??
isTest: true,
onFailure: async () => billing.request({ plan: Same here ?? }),
});
Thank you for your reply .
But The link does not give any clear ideas of how managed billing would request billing right away . So I would not be using billing api . but still once a person installs the app , It should request billing right away thats what I am looking for , Any help would be appreciated .
hey i am stuck on managed pricing i have figured out to do redirection
// Working redirect component that bypasses X-Frame issues
function DirectRedirect({ shopName, appHandle }) {
useEffect(() => {
// Use window.top to break out of the iframe
const redirectUrl = \`https://admin.shopify.com/store/${shopName}/charges/${appHandle}/pricing_plans\`;
// Method 1: Try to break out of iframe
if (window.top !== window.self) {
window.top.location.href = redirectUrl;
} else {
// Method 2: Direct redirect if not in iframe
window.location.href = redirectUrl;
}
}, [shopName, appHandle]);
return (
<div style={{ padding: "50px", textAlign: "center" }}>
<p>Redirecting to subscription page...</p>
</div>
);
}
but issue is subcription works but charges are not added in teh bill
Hi, the second link shows exactly how to do this, if you read the issue and follow the links on it. It will show you how to do this. E.g. Redirect to the plan selection page
You should just use browser open() rather than working on window.location etc as its cleaner and you don’t need to do any of the logic you listed.
You can see examples of how to use this here Navigation and click on Javascript on the examples.
Please could you clarify what you mean by
issue is subcription works but charges are not added in teh bill