I want to create a system that works similar to stripe. There'll be live API keys, as well as test API keys. I have been thinking of how to implement this architecture, and I am not sure the best way to go about it. I found a similar question on this but it didn't help much.
Architecturing testmode/livemode using OAuth 2 token
My current progress is basically:
pub_key_<token> and test_key_<token> and remove or strip the prefix before authenticationHowever, after authenticating the request from a test api token, it's unclear how to route or perform requests to TestAcoount instead of LiveAccount.
Please any ideas or a better implementation strategy is highly welcomed
stackoverflow link: https://stackoverflow.com/questions/67995479/create-accounts-and-api-tokens-for-live-mode-and-test-mode