Step 2 - Configure the integration method
PayTabs provides you with the backend packages that make the integrating with PayTabs payment gateway very easy by providing ready-made classes that handle the payment process.
After you have set up our Node.js package successfully, as clarified in the last step (Step 1 - Node.js Package | Setup and activate the integration method), you can now manage your integration configuration to start using our package easily. Kindly check the below steps that will walk you through how to configure the package:
Configure the integration
Open your Node.js project directory.
You will have to require the package and set the main configurations as shown below in your module:
const paytabs = require('paytabs_pt2');
let profileID = "8***4",
serverKey = "SJJNZ****D-J2J****ML6-99******DZ",
region = "SAR";
paytabs.setConfig( profileID, serverKey, region);
Integration keys and details
ProfileID
Name | profileID |
---|---|
Type | INT |
Description | The merchant Profile ID you can get from your PayTabs dashboard. For more information please check our How to get your account information from PT2 Dashboard? solution article. To know more about this parameter please click here. |
Description | Accept only valid profile number. |
Default | - |
Required | ✔ |
Example |
|
ServerKey
Name | serverKey |
---|---|
Type | STRING |
Description | The merchant profile's server key which used for authentication purposes. You can get it from your dashboard. To know more about how, please check our How to get my Authentication/Integration/API Keys? solution article.. |
Description | Accept only a valid server key that is associated with the profile ID. |
Default | - |
Required | ✔ |
Example |
|
Region
Name | region | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Type | STRING | ||||||||||||||||
Description | Indicates the merchant account's country. It must be related to the profile used in the integration. Please check our What is my (Region)/(endpoint URL)? solution article. | ||||||||||||||||
Description |
| ||||||||||||||||
Default | - | ||||||||||||||||
Required | ✔ | ||||||||||||||||
Example |
|