Skip to content
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

Billing is requested in some stores in a test state. #574

Open
maneko00 opened this issue Jan 12, 2024 · 9 comments
Open

Billing is requested in some stores in a test state. #574

maneko00 opened this issue Jan 12, 2024 · 9 comments

Comments

@maneko00
Copy link

Issue summary

App billing is only requested in some stores in a test state. I believe this is a bug.
Please let me know the solution.

The store plans requested in the test condition were Custom and Shopify Plus.
However, the majority of stores on the same plans do not have billing requested in the test condition.

  • @shopify/shopify-app-remix package and version:1.3.0
  • Operating system: Mac
    shopify.server.js
export const MONTHLY_PLAN = 'Basic';
const shopify = shopifyApp({
  billing: {
    [MONTHLY_PLAN]: {
      amount: 3.49,
      currencyCode: 'USD',
      interval: BillingInterval.Every30Days,
      trialDays: 7
    },
  },
});

routes/app.jsx

import { MONTHLY_PLAN, authenticate } from "~/shopify.server";
export async function loader({ request }) {
  const { billing } = await authenticate.admin(request);
  await billing.require({
    plans: [MONTHLY_PLAN],
    isTest: false,
    onFailure: async () => billing.request({
      plan: MONTHLY_PLAN,
      isTest: false,
    }),
  });
}
@paulomarg
Copy link
Contributor

Hi, thanks for raising this. Based on the code samples, it seems to me like your app should be requesting non-test payments for every store, so I'm surprised to see the difference in behaviour.

A few questions:

  • is it possible that you have a different loader or action that's setting the flag to true?
  • have you changed this code after you started making "real" payment requests?
  • could the test charges be from before you switched on real payments? E.g. if you transferred a development store?

Unfortunately, it's difficult for me to tell what's going wrong here just based on the code. If you're able to get a set of steps to reliably reproduce this, we can fix it if it's a bug, but otherwise you could try contacting support to see if they can help identify the issue based on the affected stores.

@maneko00
Copy link
Author

Thank you for your response.

  • is it possible that you have a different loader or action that's setting the flag to true?
    -> No, the flag is fixed to false.
  • have you changed this code after you started making "real" payment requests?
    -> Yes I have.
  • could the test charges be from before you switched on real payments? E.g. if you transferred a development store?
    -> I do not know how to check about it.

I will try contacting support to see if they can help identify the issue based on the affected stores.

@maneko00
Copy link
Author

I contacted support and they were able to identify the problem with the store in question.

We have found that the store is connected to a Shopify staff test shop. This would automatically create testing billing plans, usually intended for app troubleshooting on staff test shops, so that's why you are seeing the issue pop up there.

@MathiasGr
Copy link

Hey there - getting stuck with this because this makes billing.require be stuck in an infinite loop when Shopify Staff test our app for validation:

  1. billing.require requests billing with isTest: false
  2. Since it's a Shopify staff, they go through the new sub flow, and end up with a test Subscription anyways!
  3. They're redirected to our app, and billing.require doesn't like the test subscription, and redirects them to the Subscription creation page again.

I believe this is blocking Shopify staff from testing any app using that API. It must be prioritized as a P0 issue, or at least give guidance on how to bypass that!!

@paulomarg
Copy link
Contributor

paulomarg commented Jan 29, 2024

Hey, I think you're spot on - staff stores might be the problem here. We're investigating the ideal way of detecting that scenario so we can forcibly accept test purchases in that case. Thanks for the info folks, this was super helpful!

@maneko00 as for the original issue (the unexpected test purchases), is there anything unexpected happening in the package code because of that?

Copy link
Contributor

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.

@github-actions github-actions bot added the Stale label Mar 30, 2024
@maneko00
Copy link
Author

@paulomarg
Sorry I missed that.
Could you please explain in a different way because I can't understand the question?

@github-actions github-actions bot removed the Stale label Apr 15, 2024
@paulomarg
Copy link
Contributor

I was just wondering if you had any problems because of the incorrect purchases (like if the app ran into any errors because of them), but it seems that the app goes into a loop in those cases, right?

I'm still following up with the team to see if we can find a solution for this.

@maneko00
Copy link
Author

Yes, it is.
I hope that you can resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants