App reviews, troubleshooting, and recommendations
Hey Community!
I am working on a Shopify embedded app, created using CLI and Nodejs latest template but I am facing a problem in enabling Recurring Billing. I am not able to enable the billing. I want to know how I can enable the billing in Nodejs latest Template. When I was using the old Template it works fine but due to a change in the template, I didn't able to enable billing in it. I done the same that is written in shopify.js file which is in the template but it didn't work.
This is the code for Enable billing in Shopify I use.
import { BillingInterval, LATEST_API_VERSION, BillingReplacementBehavior } from "@shopify/shopify-api";
import { shopifyApp } from "@shopify/shopify-app-express";
import { SQLiteSessionStorage } from "@shopify/shopify-app-session-storage-sqlite";
import { restResources } from "@shopify/shopify-api/rest/admin/2023-01";
const DB_PATH = `${process.cwd()}/database.sqlite`;
// The transactions with Shopify will always be marked as test transactions, unless NODE_ENV is production.
// See the ensureBilling helper to learn more about billing in this template.
const billingConfig = {
"My Shopify Charge": {
// This is an example configuration that would do a one-time charge for $5 (only USD is currently supported)
amount: 5.0,
currencyCode: "USD",
interval: BillingInterval.Every30Days,
},
};
const shopify = shopifyApp({
api: {
apiVersion: LATEST_API_VERSION,
restResources,
billing: billingConfig, //undefined or replace with billingConfig above to enable example billing
},
auth: {
path: "/api/auth",
callbackPath: "/api/auth/callback",
},
webhooks: {
path: "/api/webhooks",
},
// This should be replaced with your preferred storage strategy
sessionStorage: new SQLiteSessionStorage(DB_PATH),
});
export default shopify;
Please Guide me Thanks in advance!
Solved! Go to the solution
This is an accepted solution.
@ranawaqarahmad Hey bro! Please check the following post. and please let me know if you got something. I think it will help you. I am also checking it.
https://community.shopify.com/c/shopify-apis-and-sdks/billing-plans-for-our-apps-node-template-in-sh...
@syedusama0786 I'm also having the same issue... Have you found something? If so please share it with me too. Thanks...
Didn't Got yet
okay..
This is an accepted solution.
@ranawaqarahmad Hey bro! Please check the following post. and please let me know if you got something. I think it will help you. I am also checking it.
https://community.shopify.com/c/shopify-apis-and-sdks/billing-plans-for-our-apps-node-template-in-sh...
@ranawaqarahmad Hey!
I got the solution and I enable my billing on the new template...
yes sure what do you want to know?
Hi @syedusama0786,
I am new to shopify application development.
I am trying to follow the documentation for billing plan implementation. But there is nothing happening on my sandbox.
I tried to understand the shared link information by creating a /api/auth/callback route and to test the billing, but nothing.
There must be some detail that a novice can't understand in the documentation.
I would like to know step by step how to activate billing plans.
Thanks for your help.
I have found that : https://workshops.shopify.dev/workshops/usage-billing#4
containing a better explanation
@rayvvond Bro I also use this link to enable billing you have to use the billing code as an middleware in index.js file.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024