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

Shopify Remix Billing API - Issues with Test Mode #708

Closed
polymorphtech opened this issue May 12, 2024 · 5 comments
Closed

Shopify Remix Billing API - Issues with Test Mode #708

polymorphtech opened this issue May 12, 2024 · 5 comments

Comments

@polymorphtech
Copy link

polymorphtech commented May 12, 2024

I'm stuck in the final stages of app approval due to challenges with the Remix Billing API.

  • When I test my my app on my development store, I am able to successfully initiate real, non-test charges (initiate, but not complete, because development stores cannot process real charges).
  • However, when the app store review team tests my app on a non-development store, they tell me they experience only test charges (Screencast)
  • Since developers cannot test apps on non-development stores, the app store team tried to give me staff access to a non-development store so I could replicate the issue they're seeing. But that didn't work as the staff access still had permissions issues and did not allow me to access the page to approve charges (Screenshot)

Here are all the calls I make to the Billing API:

const billingTest = false;
const { billing } = await authenticate.admin(request);

const { hasActivePayment, appSubscriptions } =
await billing.check({
plans: [MONTHLY_PLAN],
isTest: billingTest,
});

await billing.cancel({
subscriptionId: appSubscriptions[0].id,
isTest: billingTest,
prorate: true,
});

await billing.require({
plans: [MONTHLY_PLAN],
isTest: billingTest,
onFailure: async () => billing.request({ plan: MONTHLY_PLAN, isTest: billingTest, returnUrl: planPageUrl }),
});`

Here is a stackblitz for the "Plan" page.

Appreciate guidance from the dev team

Expected behavior

Real non-test charges should be initiated on all stores: development & non-development stores

Actual behavior

Real non-test charges are being initiated on development stores. Questionable behaviour occurring on non-development stores

@lizkenyon
Copy link
Contributor

Hi there 👋

I believe what is happening here is actually this:

The App reviewer is testing your app on a Staff Plan store. This store can only create test charges not real charges.
Even though you have set isTest to false, a test charge is created.

Your billing.check method checks to see if a non test charge has been created, which none have. (A test charge was created.)
Because a real charge was not created, your application sends them back to billing plan page.

We are looking to add a feature in the future, to detect if a shop is a Staff store so that we can provide this information to the billing.check method to default the isTest to true in those scenarios.

In the meantime you may need to set isTest to true while your app is being reviewed.

If this is not the issue, and you are being told that you should be creating real charges in the App Review process you may want to reach out to partner support for clarification.

@polymorphtech
Copy link
Author

Thanks for the swift response, Liz.

  • I had a feeling staff stores had some different behaviour going on, thank you for confirming that is the case
  • To confirm, you're suggesting to make isTest true for just the billing.check method call, correct?
  • And this is because staff stores override the isTest flag to make them true on billing method calls

@lizkenyon
Copy link
Contributor

Hi there 👋

As I do not know the feedback you received from the app reviewer, I can't tell you for sure what the next steps are to take.

If the feedback was the app goes into a loop after accepting the charge, then you will need to ensure that stores using test charges work, and that could mean making isTest true in your billing.check while your app is in the review process.

As this doesn't seem to be a bug in this library, I will be closing this ticket.

Best of luck on your app building journey!

@maneko00
Copy link

maneko00 commented May 30, 2024

Hi @lizkenyon,

Can the app developer detect if the shop is a Staff store ?
If the app that has already been published is to be reviewed, isTest cannot be set to true.

@lizkenyon
Copy link
Contributor

The plan is available on the Shop object..

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

No branches or pull requests

3 participants