Set up an external website that registers/login user and process user payment there. Then in your app, require user login and then your app can communicate with the backend to check if the user is subscribed.
On the other hand, some people prefer to pay within app. I don't trust many subscription services to be responsible with my credit card information, but Apple/Google have proven to have consumer protection. So you should probably do both.