PayFort has partnered with ValU in Egypt to offer consumer financing services. Now your customer's can purchase on short-term financing and repay the amount over a specific installment plan at an interest rate offered by ValU. Its simple and secure financing platform.
How it works?
- Customer verification
Your site sends request to verify whether the customer is a ValU registered customer or not. The customer's phone number is verified against the ValU registered user database. Based on the customer's phone number ValU's system validates whether customer is registered on its platform or not.
- OTP Generation
If your customer is already registered on the ValU' platform then on the checkout page the customer will provide the phone number. The ValU will generate OTP code and send it to the customer via SMS.
- Verify OTP
Once the customer fills the OTP in the checkout page it is verified.
- Purchase
Once OTP is verified the customer can proceed to purchase the selected items.
Endpoints
Use the below Endpoints for testing your integration and going live.
Sandbox
POST https://sbpaymentservices.payfort.com/FortAPI/paymentApi
Live
POST https://paymentservices.payfort.com/FortAPI/paymentApi
Parameter Submission Type For All Request Submission
REST POST request using JSON is sent for OTP generation request submission.
Customer Verification
The very first step in the ValU integration is the customer verification.
Customer Verification Request Sample
Here is the sample JSON based customer verification request that you need to send to PayFort
{
"service_command":"CUSTOMER_VERIFY",
"merchant_reference":"XYZ9239-yu898",
"merchant_identifier":"CycHZxVj",
"access_code":"zx0IPmPy5jp1vAz8Kpg7",
"language":"en",
"payment_option":"VALU",
"phone_number":"00008557694",
"signature":"54efbd76bd644e9ef237c39137bf5d2304dc1bfdf6f6302065b448f2456a07a7"
}
Customer Verification Response Sample
Here is the sample of JSON based customer verification response that you will receive from PayFort
{
"response_code":"90000",
"response_message":"Success",
"service_command":"CUSTOMER_VERIFY",
"signature":"27c1303138f8718e56f311d1b3d823b5a644e6bcd4fac43d5454955b13b5b337",
"merchant_identifier":"CycHZxVj",
"merchant_reference":"XYZ2939-yu898",
"access_code":"zx0IPmPy5jp1vAz8Kpg7",
"payment_option":"VALU",
"language":"en",
"phone_number":"00008557694",
"status":"90"
}
OTP Generation
For the customer already registered on the ValU platform, they need to provide their phone number on your site's check out page. After phone number is added, OTP would be generated by the ValU platform and the same would be provided to your customer through SMS.
OTP Generation Request Sample
Here is the sample JSON based OTP generation request sample. Request sent to PayFort must also include the product parameters as shown here.
{
"merchant_reference":"XYZ9239-yu898",
"merchant_identifier":"CycHZxVj",
"access_code":"zx0IPmPy5jp1vAz8Kpg7",
"signature":"fb1a8978eff0df5700007f3a0ca7964f61eb4b3c17de0a43029851b84687699d",
"service_command":"OTP_GENERATE",
"language":"en",
"payment_option":"VALU",
"phone_number":"00008557694",
"merchant_order_id":"Valu123",
"amount":"10000",
"currency":"EGP",
"products":[
{
"product_name":"iphone",
"product_price":"10000",
"product_category":"phone"
}
]
}
OTP Generation Response Sample
Here is the sample JSON based OTP generation response sample
{
"transaction_id":"240719641384",
"amount":"10000",
"currency":"EGP",
"response_code":"88000",
"merchant_order_id":"Valu123",
"signature":"2304c9a011630db5286712903e7877a53aa96aa7cfe2151fd7c6cc350ec38c12",
"merchant_identifier":"CycHZxVj",
"access_code":"zx0IPmPy5jp1vAz8Kpg7",
"payment_option":"VALU",
"language":"en",
"response_message":"Success",
"service_command":"OTP_GENERATE",
"merchant_reference":"XYZ2939-yu898",
"total_down_payment":"1200",
"phone_number":"00008557694",
"otp_status":"1",
"tenure":"6-9-12-15-18",
"status":"88"
}
OTP Verification
Once the customer receives OTP through SMS, they will provide the same on your site's checkout page. This OTP is then verified against the ValU server
OTP Verification Request Sample
Inorder to send OTP verification request you can refer to the sample as shown below
{
"signature":"d5c9c93166c34efbf72c71c9f780ce7bc336f68f9d35d63dba014175fd44af58",
"merchant_identifier":"CycHZxVj",
"merchant_reference":"XYZ9239-yu898",
"merchant_order_id":"Valu123",
"access_code":"zx0IPmPy5jp1vAz8Kpg7",
"language":"en",
"amount":"1000",
"currency":"EGP",
"payment_option":"VALU",
"service_command":"OTP_VERIFY",
"total_downpayment":1200,
"otp":"123456",
"phone_number":"00008557694"
}
OTP Verification Response Sample
The sample response sent by PayFort will also contain tenure of the EMI. Here is the tenure sample
Tenure Sample
"tenure":{
"TENURE_VM":[
{
"EMI":"2118",
"TENURE":"3",
"InterestRate":"1.76"
},
{
"EMI":"1105",
"TENURE":"6",
"InterestRate":"1.76"
},
{
"EMI":"768",
"TENURE":"9",
"InterestRate":"1.76"
},
{
"EMI":"600",
"TENURE":"12",
"InterestRate":"1.76"
},
{
"EMI":"500",
"TENURE":"15",
"InterestRate":"1.76"
},
]
},
Here is the sample JSON response sent from PayFORT server.
{
"amount":"10000",
"currency":"EGP",
"response_code":"92182",
"merchant_order_id":"Valu123",
"signature":"4bfc2476c6e42b6c1fc9539dbf5092bbc8a2493820816800f98f110c4453b5cd",
"merchant_identifier":"CycHZxVj",
"access_code":"zx0IPmPy5jp1vAz8Kpg7",
"payment_option":"VALU",
"language":"en",
"total_downpayment":"0",
"service_command":"OTP_VERIFY",
"response_message":"OTP verification success",
"merchant_reference":"XYZ2939-yu898",
"phone_number":"00008557694",
"otp_status":"1",
"tenure":{
"TENURE_VM":[
{
"EMI":"2118",
"TENURE":"3",
"InterestRate":"1.76"
},
{
"EMI":"1105",
"TENURE":"6",
"InterestRate":"1.76"
},
{
"EMI":"768",
"TENURE":"9",
"InterestRate":"1.76"
},
{
"EMI":"600",
"TENURE":"12",
"InterestRate":"1.76"
},
{
"EMI":"500",
"TENURE":"15",
"InterestRate":"1.76"
},
]
},
"status":"92"
}
Purchase
Once the OTP has been verified the customer can purchase the selected product. Your site will forward the purchase request to PayFort.
Purchase Request Sample
Here is the JSON sample of purchase request sent to PayFort.
{
"merchant_reference":"XYZ9239-yu898",
"merchant_identifier":"CycHZxVj",
"access_code":"zx0IPmPy5jp1vAz8Kpg7",
"signature":"b574e362cc08d7504d8277e71400132f06064ee1537cd570717569b583dec0b5",
"command":"PURCHASE",
"language":"en",
"payment_option":"VALU",
"phone_number":"00008557694",
"amount":"10000",
"currency":"EGP",
"customer_email":"customer@domain.com",
"customer_code":"12348557694",
"merchant_order_id":"Valu123",
"transaction_id":"050819724899",
"otp":"123456",
"tenure":"6",
"total_down_payment":"1200",
"purchase_description":"Test"
}
Purchase Response Sample
Here is the response sample sent from PayFort
{
"amount":"10000",
"response_code":"14000",
"signature":"afac5bd50250743cbd87ce208b1aabcae1080b9060bdb7212cf2c36e201cd6d0",
"merchant_identifier":"CycHZxVj",
"access_code":"zx0IPmPy5jp1vAz8Kpg7",
"payment_option":"VALU",
"customer_ip":"192.178.1.10",
"language":"en",
"eci":"ECOMMERCE",
"fort_id":"149295435400084008",
"command":"PURCHASE",
"response_message":"Success",
"merchant_reference":"XYZ2939-yu898",
"customer_email":"customer@domain.com",
"currency":"EGP",
"phone_number":"00008557694",
"status":"14"
}
Signature
SHA algorithm generates a digital signature which is used to authenticate the sender and receiver of the message. It allows the receiver to verify the Integrity of the message. In this case your site acts as sender while PayFort server acts as a receiver thus by passing the signature parameter it is ensured that high level of security is in place when the message is sent and received. It also ensures that all the messages sent are encrypted using the signature. Below table describes the signature details
Signature Description
Name | Values | Description |
---|---|---|
SHA Type | * SHA-256 * SHA-512 |
The Secure Hash Algorithm is a family of cryptographic hash functions published by the National Institute of Standards and Technology (NIST) as a U.S. Federal Information Processing Standard (FIPS), including: SHA-0, SHA-1, SHA-2, SHA-3. |
SHA Request Phrase | Dynamic value defined by the Merchant | This value is used when the Merchant generates the request signature. |
SHA Response Phrase | Dynamic value defined by the Merchant | This value is used by our system to generate the response signature for the Merchant's Request. |
Signature Pattern
The below steps describe the signature pattern:
- Sort all PayFort requests parameters (both mandatory and optional) in an ascending alphabetical order based on the parameters names.
- Concatenate the parameter name with the value separated by '=' (param_name=param_value).
- Concatenate all the parameters directly without any separator. (param_name1=param_value1param_name2=param_value2).
- Add the Merchant's Passphrase at the beginning and end of the parameters string. (REQUESTPHRASEparam_name1=param_value1param_name2=param_value2REQUESTP HRASE).
- Use the SHA function to generate the SHA value of the resulted string depending on the type of SHA selected by the Merchant.
The following is an example for the Customer Verification - Request signature calculations:
Assume you have the below parameters included in the request of customer verification:
- service_command = CUSTOMER_VERIFY
- merchant_identifier = CycHZxVj
- merchant_reference = XYZ9239-yu898
- access_code = zx0IPmPy5jp1vAz8Kpg7
- language = en
- payment_option = VALU
- phone_number = 00008557694
Below are the Merchant signature settings from the back-office:
SHA Request Phrase: PASS
SHA-Type: SHA-256
The string to hash should be prepared for the above request is the following “step 4 of the Signature Pattern”:
PASSaccess_code=zx0IPmPy5jp1vAz8Kpg7language=enmerchant_identifier=CycHZxVjmerchant_reference=X
YZ9239- yu898payment_option=VALUphone_number=00008557694service_command=CUSTOMER_VERIFYPASS
After applying step 5 of the Signature pattern, the result will be as follows:
Signature = f0c49b9dae92b3da04d82689f698189ac65f62596280cd253cb24130ce5a1ed6
The following is an example for the OTP Generation – Request signature calculations:
Assume you have the below parameters included in the request of generate OTP:
-
service_command = OTP_GENERATE
-
access_code = zx0IPmPy5jp1vAz8Kpg7
-
merchant_identifier = CycHZxVj
-
merchant_reference = XYZ9239-yu898
-
payment_option = VALU
-
phone_number = 00008557694
-
merchant_order_id = Valu123
-
amount = 10000
-
currency = EGP
-
products = [ { "product_name":"iphone", "product_price":"10000", "product_category":"phone" } ]
Below are the Merchant signature settings from the back-office:
SHA Request Phrase: PASS
SHA-Type: SHA-256
The string to hash should be prepared for the above request is the following “step 4 of the Signature Pattern”:
products = [ {"product_name":"iphone", "product_price":"10000", "product_category":"phone" } ]
products=[{product_name=iphone, product_price=10000, product_category=phone}]
PASSaccess_code=zx0IPmPy5jp1vAz8Kpg7amount=10000currency=EGPlanguage=enmerchant_identifier=Cy cHZxVjmerchant_order_id=Valu123merchant_reference=XYZ9239- yu898payment_option=VALUphone_number=00008557694products=[{product_name=iphone, product_price=10000, product_category=phone}]service_command=OTP_GENERATEPASS After applying step 5 of the Signature pattern, the result will be as follows: Signature = c9a58adbe7fa5311b79a6362f28aa3e02c10cde5a37f10456e1caa6bd06a6951
Transaction’s Response Codes
Please visit the link to check the transaction codes and messages related to ValU service.
Go to Full API
Check out our full API by visiting this link
Need further help?
Thanks for using PayFort.com. If you need any help or support, then message our support team at support@payfort.com.