Paytabs provides you with a collection of API endpoints which used to process all payments, regardless of if they are through either your own payment pages, the managed payment pages, or if you are using the hosted payment pages. 


This article is dedicated to the clarification of the Profile ID (paypage_lang) parameter. "paypage_lang" is one of the mandatory parameters that the request should have, which indicates the payment page language that will be displayed to the customers. 

Customers will still have the ability to switch languages within the page itself which will be easier for your customer to navigate the payment page in his preferred language.



In this article, you will be going to know:



Specifications 


The Parameter Tag/Namepaypage_lang
JSON Example
{ "paypage_lang": "en" }
Data TypeString
Required
Validation Rules
  • Only “en” or “ar” is supported



Usage Workflow


Along with the required parameters mentioned in our Step 3 - PT2 API Endpoints | Initiating the payment solution article, you may need to set the "paypage_lang" as shown below:


Sample Request Payload

    

{
    "profile_id": "987654",
    "tran_type": "sale",
    "tran_class": "ecom",
    "cart_id": "CART#1001",
    "cart_currency": "USD",
    "cart_amount": 500,
    "cart_description": "Description of the items/services",

    "paypage_lang": "en"
}


Sample Response Payload
   

{
    "tran_ref": "TST2231101374414",
    "tran_type": "Sale",
    "cart_id": "CART#1001",
    "cart_description": "Description of the items/services",
    "cart_currency": "USD",
    "cart_amount": "500.00",
    "tran_currency": "",
    "tran_total": "0",
    "return": "none",
    "redirect_url": "https://secure-egypt.paytabs.com/payment/page/599**ED7",
    "serviceId": 2,
    "profileId": 987654,
    "merchantId": 123456,
    "trace": "PMNT0404.6368BC3D.000BAF4C"
}

The Expected Parameter Behaviors


The Payment Page will display the language you choose. If you didn't define the PayPage language Paytabs Payment Page by default will use the client's browser preferred language as the default language/


The expected behaviors according to the passed value are:


  • Override/Customize language file


You can change the various text, labels, and buttons used within the payment pages by uploading a language file to your PayTabs dashboard. Navigate to the Developers menu then select the PayPage Language link:



Now you can upload the language file by choosing the file and then clicking on submit as shown below:



The Language file specifications:


  • The file must be in text format (ar_lang.txt). 
  • File encoding must be either plain ASCII or UTF-8 encoded.
  • They must be constructed using 'tag = value' entries, one entry per line.
  • Each file must contain the tags 'language_name' and 'language_code', which set the display name of the language and the code used to select it.
  • You can override existing system-defined tags by uploading your own file for the same language, for example:

    language_code = en
    lnguage_name = English
    hpp_makepayment = Confirm Order