NAV Navbar
Logo

Before Starting the Integration

These are the steps you need to know; to start building an integration with PayFort:

Step 1: Access your test account
You have to make sure that you have an access to a test account, its a full test environment allow you to simulate and process simulation transactions.

Step 2: make sure that you are using the correct integration type
Before building the integration, you need to make sure that you are selecting and using the proper parameters in the API calls as per the required integration type.

All the mandatory parameters mentioned under every section in the API document.

Step 3: Create the transaction request
Process the valid API request depends on transaction parameters included, you need to check the documentation and read every parameter possible values in order to reduce the errors in processing the transaction.

Step 4: Process the transaction response
After every payment, PayFort return the transaction response on the URL configured in your account under Technical Settings channel configuration.

You can find more details in the API documentation section Direct Transaction Feedback.

You need to validate the response parameters returned on this URL by calculating the signature for the response parameters using the SHA Response Phrase configured in your account under Security Settings.

Step 5: Test and Go Live You can use our testing cards to test your integration and simulate your test cases.

PayFort team may require to test your integration before going live to assure your application integration.

Recurring Transactions

Recurring transactions allows the Merchant to charge Customer’s card a specific amount on regular basis using the Purchase operation configured in single message mode. For example, the Merchant will be charging his Customer’s card the subscription fee on monthly basis.

How It Works - Overview

1. The Merchant has to have a Token created assigned to a specific Customer account. For more details on “Token” please refer to the FORT Tokenization Service.
2. The Merchant’s server sends the recurring transaction details along with the Customer’s Token to PayFort.
3. The transaction is processed and a valid response is returned to the Merchant servers indicating the status of the transaction.

Recurring URLs

Test Environment URL:

https://sbpaymentservices.payfort.com/FortAPI/paymentApi

Production Environment URL:

https://paymentservices.payfort.com/FortAPI/paymentApi

Parameters Submission Type

REST POST request using JSON.

Recurring - Request

Include the following parameters in the Request you will send to PayFort:

ATTRIBUTES Description
command
Alpha
Mandatory
max: 20
command.
Possible/ expected values: PURCHASE
access_code
Alphanumeric
Mandatory
max: 20
Access code.
Example: zx0IPmPy5jp1vAz
merchant_identifier
Alphanumeric
Mandatory
max: 20
The ID of the Merchant.
Example: CycHZxVj
merchant_reference
Alphanumeric
Mandatory
max: 40
The Merchant’s unique order number.
Example: XYZ9239-yu898
Special characters: - _ .
amount
Numeric
Mandatory
max: 10
The transaction’s amount. *Each currency has predefined allowed decimal points that should be taken into consideration when sending the amount.
Example: 10000
currency
Alpha
Mandatory
max: 3
The currency of the transaction’s amount in ISO code 3.
Example: AED
language
Alpha
Mandatory
max: 2
The checkout page and messages language.
Possible/ expected values: en / ar
customer_email
Alphanumeric
Mandatory
max: 254
The customer’s email.
Example: customer@domain.com
Special characters: _ - . @ +
eci
Alpha
Mandatory
max: 16
Ecommerce indicator.
Possible/ expected values: RECURRING
token_name
Alphanumeric
Mandatory
max: 100
The Token received from the Tokenization process.
Example: Op9Vmp
Special characters: _ - . @
signature
Alphanumeric
Mandatory
max: 200
A string hashed using the Secure Hash Algorithm. (Please refer to section Signature for more details).
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
payment_option
Alpha
Optional
Max: 10
Payment option.
Possible/ expected values:
- MASTERCARD
- VISA
- AMEX
order_description
Alphanumeric
Optional
max: 150
It holds the description of the order.
Example: iPhone 6-S
Special characters: ' / . _ - # : $ Space
customer_name
Alpha
Optional
max: 40
The customer’s name.
Example: John Smith
Special characters: _ \ / - . ' Space
merchant_extra
Alphanumeric
Optional
Max: 999
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
Special characters: . ; / _ - , ' @
merchant_extra1
Alphanumeric
Optional
Max: 250
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
Special characters: . ; / _ - , ' @
merchant_extra2
Alphanumeric
Optional
Max: 250
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
Special characters: . ; / _ - , ' @
merchant_extra3
Alphanumeric
Optional
Max: 250
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
Special characters: . ; / _ - , ' @
merchant_extra4
Alphanumeric
Optional
Max: 250
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
Special characters: . ; / _ - , ' @
phone_number
Alphanumeric
Optional
max: 19
The customer’s phone number.
Example: 00962797219966
Special characters: + - ( ) Space
settlement_reference
Alphanumeric
Optional
max: 34
The Merchant submits this value to the FORT. The value is then passed to the Acquiring bank and displayed to the merchant in the Acquirer settlement file.
Example: XYZ9239-yu898
Special characters: - _ .

Recurring - Response

The following parameters will be returned in PayFort’s Response:

ATTRIBUTES Description
command
Alpha
max: 20
command.
Possible/ expected values: PURCHASE
access_code
Alphanumeric
max: 20
Access code.
Example: zx0IPmPy5jp1vAz
merchant_identifier
Alphanumeric
max: 20
The ID of the Merchant.
Example: CycHZxVj
merchant_reference
Alphanumeric
max: 40
The Merchant’s unique order number.
Example: XYZ9239-yu898
amount
Numeric
max: 10
The transaction’s amount.
Example: 10000
currency
Alpha
max: 3
The currency of the transaction’s amount in ISO code 3.
Example: AED
language
Alpha
max: 2
The checkout page and messages language.
Possible/ expected values: en / ar
customer_email
Alphanumeric
max: 254
The customer’s email.
Example: customer@domain.com
eci
Alpha
max: 16
Ecommerce indicator.
Possible/ expected values: RECURRING
token_name
Alphanumeric
max: 100
The Token received from the Tokenization process.
Example: Op9Vmp
signature
Alphanumeric
max: 200
A string hashed using the Secure Hash Algorithm. (Please refer to section Signature for more details).
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
fort_id
Numeric
max: 20
The order’s unique reference returned by our system.
Example: 149295435400084008
payment_option
Alpha
Max: 10
Payment option.
Possible/ expected values:
- MASTERCARD
- VISA
- AMEX
order_description
Alphanumeric
max: 150
It holds the description of the order.
Example: iPhone 6-S
customer_name
Alpha
max: 40
The customer’s name.
Example: John Smith
merchant_extra
Alphanumeric
Max: 999
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
merchant_extra1
Alphanumeric
Max: 250
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
merchant_extra2
Alphanumeric
Max: 250
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
merchant_extra3
Alphanumeric
Max: 250
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
merchant_extra4
Alphanumeric
Max: 250
Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.
Example: JohnSmith
expiry_date
Numeric
Max: 4
The card’s expiry date.
Example: 2105
card_number
Numeric
Max: 16
The clear credit card’s number.
Example: 400555******0001
authorization_code
Alphanumeric
max: 100
The authorization code returned from the 3rd party.
Example: P1000000000000372136
response_message
Alphanumeric
max: 150
Message description of the response code. It returns according to the request language.
Possible/ expected values: Please refer to section messages
response_code
Numeric
Max: 5
Response Code carries the value of our system’s response. *The code consists of five digits, the first 2 digits represent the response status, and the last 3 digits represent the response messages.
Example: 20064
status
Numeric
max: 2
A two-digit numeric value that indicates the status of the transaction
Possible/ expected values: (Please refer to section statuses).
phone_number
Alphanumeric
max: 19
The customer’s phone number.
Example: 00962797219966
settlement_reference
Alphanumeric
max: 34
The Merchant submits this value to the FORT. The value is then passed to the Acquiring bank and displayed to the merchant in the Acquirer settlement file.
Example: XYZ9239-yu898

FORT Transaction Feedback

Overview

The FORT transaction Feedback system provides Merchants with two types of configurable notifications:
1. Direct Transaction Feedback, PayFort will send Merchants HTTPs notifications that inform Merchants of the transaction’s final status whenever a transaction is processed.
2. Notification Transaction Feedback, PayFort will send Merchants HTTPs notifications that inform Merchants of the transaction’s final status whenever a transaction status is updated.

Registering Transaction Feedback URLs

1. Log in to your back-office account.
2. Select the active channel under Integration Settings > Technical Settings.
3. Enter your Direct Transaction Feedback URL and Notification Transaction Feedback URL.
4. Click “Save Changes” button.

Transaction Feedback submission

The FORT will send Transaction Feedback data as form POST Parameters to the Merchant’s Transaction Feedback URLs.
However if you want to change the submission type to JSON or XML, you can contact us on integration@payfort.com.
This configuration can be enabled by internal PayFort team only
The specifics of the data will differ based upon the financial operation that has been processed.
Please refer to the FORT integration guide for more details.

Responding to FORT Transaction Feedback

Beyond whatever your Transaction Feedback URL does with the data received, it must also return a 2xx (like 200 , 201 , etc…) or 302 HTTP status code to tell the FORT that the notification was received. If your URL does not return 2xx or 302, the FORT will continue to retry the notification until it’s properly acknowledged.
In case the FORT does not receive 200 or 302 HTTP status code it will attempt to send the notification for 10 times with 10 seconds in between.
This configuration is editable as well, if you want to change the grace period or the time interval between the retries please contact us on integration@payfort.com.