As a partner, you are able to specify the URI where you wish to send a merchant after they authorise your app.
This redirect URI is set when you setup your app within the dashboard. When you then create the OAuth link to send to a merchant, you must set the redirect_uri to be the same as that stored against your app.
If you’re a partner that has multiple domains registered to one system e.g. a club management system with a different domain for every club, this can be problematic, as you may wish to redirect merchants back to different domains, depending on which club they are associated with.
The solution to this is to have one generic redirect, and to then send merchants on to the appropriate URL once they've been redirected back to you.
The process would be as follows:
- When creating the Oauth link, you specify a state parameter, identifying the merchant. You then redirect the merchant to the created URL.
- Merchant authorises the app.
- Merchant gets redirected to the redirect URI set in the partner app.
- You receive the merchant, check the state parameter and then redirect them further to the required page.