In some cases, you may need to switch between your different PayTabs profiles among different regions within the same integration method for your business needs. For example, you have multiple branches in KSA, UAE, and Egypt. Each branch of them of course has its own account and different dashboard domains. In this article, you will learn how to switch the profiles within your same integrated system.
You may need to check our "How to control the payment method on the payment page?" solution article to know more about enabling/disabling payment types in our Hosted Payment Page.
In this article, you will learn how to control that via:
- How to access the PayTabs' different dashboard domains via regions?
- Code Business Flow
- eCommerce Plugins
- Backend Libraries/Packages
- SDK mobile
- API Endpoints
How to access the PayTabs' different dashboard domains via regions?
First Option
- Navigate to our login page from here.
- Choose PT v2 option, then select your dashboard region and click on the "Login" button.
Second Option
Navigate directly to the requested login page in each region as shown belowRegion Dashboard domain Saudi Arabia https://merchant.paytabs.sa United Arab Emirates https://merchant.paytabs.com Egypt https://merchant-egypt.paytabs.com Oman https://merchant-oman.paytabs.com Jordan https://merchant-jordan.paytabs.com Iraq https://merchant-iraq.paytabs.com Any other country https://merchant-global.paytabs.com
Code Business Flow
For better clarification, let's assume that you need to use different profiles via different regions to enable different payment methods on each profile, in this case, you will need to:
- Create a page that has images of the desired payment methods such as (Apple Pay (Visa), STC pay, ValU, etc).
- Enable each image to be clickable, to generate our hosted payment page by passing only this particular payment method along with its related profile.
So for example, when your client clicks on (e.g. Mada image for example) this will redirect the client to a hosted payment page generated using the profile ID and server key which only Mada terminal is configured in. However, if your client clicks on (e.g. ValU image) the system should redirect the client to the other profile that has only this payment method ValU, and so on. Each image (action) will hold its own profile ID and authentication keys, to create a unique payment page using this particular payment method.
This excludes, the eCommerce plugins, as it can't be done dynamically.
eCommerce Plugins
You can switch between profiles manually, as in plugins only one profile can work at a time. You will just need to seek the "Configure the Plugin" section on the solution article related to the plugin you are using from the "eCommerce Plugins" category section. You can switch the profile ID, Authentication keys, and the endpoint region you are seeking.
Only Shopify Plugin, each endpoint region has a different plugin link to use, which is clarified in our "Shopify Plugin" solution article.
Backend Libraries/Packages
You can switch between them at the same time (works in parrel) dynamically, by changing the configuration attributes on the runtime. These configuration attributes have the profile ID, authentication keys, and the payment API base URI, related to the selected payment method or country according to your business needs.
For example, you will keep all of your profile configuration information in a global collection. On each payment, you will read/change the configurations to the specified collection item accordingly.
To know where these configurations are and how they are passed, you will need to navigate to the solution article related to your backend Package from the "Backend Packages" category section and seek the "Configuration" article section.
SDK mobile
You can switch between them at the same time (works in parrel) dynamically, by changing the configuration attributes on the runtime. These configuration attributes have the profile ID, authentication keys, country code, and currency code, related to the selected payment method or country according to your business needs.
For example, you will keep all of your profile configuration information in a global collection. On each payment, you will read/change the configurations to the specified collection item accordingly.
To know where these configurations are and how they are passed, you will just need to navigate the solution article related to the mobile SDK from you are using the "Mobile SDKs" category section, then search for how the "PaymentSDKConfiguration" object is configured and passed in each payment method.
API Endpoints
You can switch between them at the same time (works in parrel) dynamically, by changing the configuration attributes on the runtime. These configuration attributes have the profile ID, and the authorization token/key, related to the selected payment method or country according to your business needs.
For example, you will keep all of your profile configuration information in a global collection, and on each payment, you will read/change the configurations to the specified collection item accordingly as below:
- Change the API endpoint base URI according to your profile region as below:
Region API Base URI Saudi Arabia https://secure.paytabs.sa United Arab Emirates https://secure.paytabs.com Egypt https://secure-egypt.paytabs.com Oman https://secure-oman.paytabs.com Jordan https://secure-jordan.paytabs.com Iraq https://secure-iraq.paytabs.com Any other country https://secure-global.paytabs.com - Then the "profile_id" passed in the request payload itself
- And finally, changing the "Authorization" parameter with the related server key as well.
To know more about how to use our latest endpoint, check our fully detailed PT2 API Endpoints Documentations.