I applied for ‘Built for Shopify’ status, and my app was under review. I had already configured my app not to charge development stores in the loader function below. However, the reviewer did not use a development store and attempted to complete a test charge, which my app does not allow. They kept trying to process test charges, but since they were not using a development store, they were unable to load my app’s page.
I am using Billing API v1 and cannot switch to managed billing because I have other settings already built on this charging method. How can I modify my app to accept test charges in this scenario?
I think since your app is configured to avoid charging development stores, the reviewer is unable to test it properly with a test charge because they weren’t using a development store. I totally understand how this can be a bit tricky, especially since you’re using Billing API v1 and can’t switch to managed billing due to your existing setup.
To help your app handle this scenario, you can make a small modification to your existing code to allow test charges when necessary, even if the store isn’t a development store. Try following the below steps:
Add a Check for Test Charges: Before enforcing the actual charge, you could add an additional check to see if the request is a test charge and allow it, regardless of whether the store is development or not. You could also consider using a flag to distinguish between a real charge and a test one.
Update the Code for Test Charges: You could make something like this work in your loader function:
const { admin, session, billing } = await authenticate.admin(request);
const isDevStore = await findShopPlan(admin);
// Check if it's a test charge
const isTestCharge = session?.test;
if (!isDevStore || isTestCharge) {
await billing.require({
plans: ['Basic'],
isTest: isTestCharge, // Allow test charges
onFailure: async () => billing.request({
plan: 'Basic',
isTest: isTestCharge, // Handle failure for test charges
}),
});
}
Allow Test Charges in the App Review: This way, you can ensure that if the reviewer is testing with a non-development store, your app will still allow them to perform test charges. The isTest: true flag will ensure that it’s treated as a test charge and not processed as a real transaction.
Communication with Shopify Review Team: If you’re not able to update this quickly or are still running into issues, it’s also a good idea to communicate with the Shopify review team. Let them know that you are handling test charges in a specific way and that you’ve set it up to prevent real charges on development stores.
I hope this helps you get your app back on track! Let me know if you need any further help
You could also have a test flag in your app’s billing logic that allows the app review team to bypass the billing requirement during their testing. This can be done by checking for a specific condition or parameter that you provide to the review team.