Razorpay: Open payment page

Hi Community,

I am new to Flutterflow and I am build an app. My app has a membership system and I am using custom API to integrate Razorpay Subscription (since the FF integrated razorpay is for single payments and doesn't support subscriptions)

I have done the custom API to create subscription which returns a URL for users to proceed with authentication using their card. Now, how will I automatically open the payment page (to authenticate) after getting the URL.

I tried "launch URL" action which actually opens the page in browser (not in-app)
I tried Webview which works well but after payment completion, it says in the same page - need to navigate them to a my subscribed page.

In custom function I see we cannot add custom dependency as there is a Razorpay Flutter in pub.dev which can be used to initiate the payment page.

Another work around I was trying to do is, after launching the URL, navigate the user to a payment processing page. But here I don't know how to keep keep the page in a loop to keep calling the API to check whether the subscription status changes form "Created" to "Authenticated"

So in a nutshell, my queries are:

1: Is there any way to launch the payment page for subscription after the subscription is created within the app automatically and once it's done return user to a success page
2: If 1 is not possible, how to keep the page checking for the status change from "Created" to "Authenticated" in the API result.

Any help or advice is greatly appreciated.

2 replies