How can I resolve a recurring charge error in my Shopify app?

I am creating a Shopify app in which users have to subscribe. So we are using Shopify’s recurring charge Graphql to manage the payments. The issue is when our app is embedded in Shopify and tries to make a payment it is showing an error as store redirected you too many times. How can I fix this?