shopify-app-template-node
shopify-app-template-node copied to clipboard
Payment recursive
I have a problem with recursive. Support rejected the app.
Video: https://shopify.click/22-09-58372-51768.webm
I think this recursive between auth.js and verify-request.js. We check the payment several times and because of this we get a recursion
I found the problem in this place: https://github.com/Shopify/shopify-app-template-node/blob/0a987b4d3de8c62540b2f4aa6e97ad0261a16e3c/web/middleware/auth.js#L40-L49
https://github.com/Shopify/shopify-app-template-node/blob/0a987b4d3de8c62540b2f4aa6e97ad0261a16e3c/web/middleware/verify-request.js#L37-L45
I was unable to fix the error. My application was rejected again! The app review team does not even give a chance and immediately rejects. The next review will be in two or three weeks.
I'm running into the same problem. What did you do to fix the issue?
I tried to remove the part of the code with re-checking the payment. It didn't work :(
@Davidkle
It's probably an old problem that hasn't been fixed. #687
I asked the question in the official discord. I recently tested it and it seems to work fine. Maybe it's an issue with their sandbox backend. Previously it did not work both during testing and during app review.
Ok I figured out the problem. It's this block of code in the node template. When running in production and when using development stores, this will always return false even though there is an active subscription. Since there can only be one active subscription, I just look for that and return true instead.
Davidkle
Did you manage to pass the review? I also detected this issue, so I set a flag to block the development store isTestStore = (shopInfo[0].plan_name == "partner_test" || shopInfo[0].plan_name == "affiliate"). But the review team's plan is "staff" so I still got into this infinite loop. Do you have any suggestion to solve this?
Yes I got it pass review.
I fetched the store info with
query GetShopInfo {
shop {
name
plan {
displayName
partnerDevelopment
shopifyPlus
}
}
}
Then used the following logic
if (shop.plan.partnerDevelopment || shop.plan.displayName === 'affiliate') {
return true;
}
I suggest to just remove this line (!isProd || !subscriptions[i].test). It's useless because whenever there are no subscriptions, the hasActivePayment will return false. When there is a subscription, just have to check if the charge name is equal to the subscription's plan name.
@Davidkle or @jeff0723 Did you manage to get this to work? I've removed the !prod and test part, and finding the first active payment and returning true on that. But i still keep ending up in an infinite loop, where it constantly redirects to /exitframe?shop=shopurl from the Shopify.Utils.getEmbeddedAppUrl() method
@tmmgrafikr I think it is too late to reply, but I could resolve the issue by adding /exitiframe (not exitframe, but exit i frame) to the client side routing
Hi folks, thanks for the discussion here, and sorry for the delayed response.
We've reworked how billing works in the version 6+ of the library so that apps have more control over when billing happens, which should make it easier to set whether a purchase is a test or not.
In addition, we've also improved the exitiframe page so that it can redirect to Shopify addresses - I believe that was the root cause of the problem here. If you're using the template version of /exitiframe, you can use this code to allow going out to Shopify.
I hope this helps! Please let me know if you still have issues with payment on the latest versions.