The Installation process for SFAClient.zip
1.
Unzip SFAClient.zip. This will create a folder
called SFAClient
2.
SFAClient contains the following files and directory.
1.
Sfa – SFA Client library (contains the PHP Sfa library)
2.
Test Pages – Sample pages for transactions and a
test page (test.php) for testing php.
3.
sfa.properties
PHP Web Application Directory Structure – Sample Example
·
Create the following PHP Web application directory structure as
given below
o E.g. the Merchant website directory name is “Merchant_Site_Dir”.
·
Copy all the directory
and files from unzipped SFAClient to Merchant_Site_Dir .
§ Place
the directory Merchant_Site_Dir in C:/wamp/www/ as shown below.
·
Sfa, Test Pages and sfa.properties
Note:
§ Sfa folder should be copied to the folder where
TestPages/Merchant pages are present.
§ The directory names are case sensitive. Create them as mention
above.
Changes in Test Pages
- Open the SFAResponse.php and made some changes
<?php
include("Sfa/EncryptionUtil.php");
$strMerchantId="00000001";
$astrFileName="c://key//sbi//00000001.key";
$astrClearData;
$ResponseCode = "";
$Message = "";
$TxnID = "";
$ePGTxnID = "";
$AuthIdCode = "";
$RRN = "";
$CVRespCode = "";
$Reserve1 = "";
$Reserve2 = "";
$Reserve3 = "";
$Reserve4 = "";
$Reserve5 = "";
$Reserve6 = "";
$Reserve7 = "";
$Reserve8 = "";
$Reserve9 = "";
$Reserve10 = "";
Note : Mercant ID must be
same as the .key file name. e.g. if file is 00000001.key then Merchant ID must
be 00000001.
- According to merchant type i.e. SSL or MOTO change select the file and make the changes
- e.g. if Merchant is SSL Merchant then change the TestSsl.php
<?php
include("Sfa/BillToAddress.php");
include("Sfa/CardInfo.php");
include("Sfa/Merchant.php");
include("Sfa/MPIData.php");
include("Sfa/ShipToAddress.php");
include("Sfa/PGResponse.php");
include("Sfa/PostLibPHP.php");
include("Sfa/PGReserveData.php");
$oMPI = new MPIData();
$oCI = new CardInfo();
$oPostLibphp = new PostLibPHP();
$oMerchant = new Merchant();
$oBTA = new BillToAddress();
$oSTA = new ShipToAddress();
$oPGResp = new PGResponse();
$oPGReserveData = new
PGReserveData();
$oMerchant->setMerchantDetails("00000001","00001203","00001203","193.545.34.33",rand()."","Ord123","http://10.10.10.167/SFAResponse.php","POST","INR","INV123","req.Sale","100","","Ext1","true","Ext3","Ext4","Ext5");
?>
Put marchant id.
- e.g. if Merchant is Moto Merchant then change the TestMoto.php
Set the key directory path
·
'Key.Directory' should contain the name of the
folder, which contains the merchant key. A trailing slash has to be included at
the end of this value. The name of the file (.key file) need not be set. Save
the file after making other relevant changes.
§
Key.Directory=D://WAMP//WWW//key//
Note: Don’t include key in key directory path.
·
Enable the verbose parameter to “true” only when
required to generate logs. These logs are to be used for debugging (while
integration) and should not be set to “true” in production as it might lead to
considerable amount of logs depending on the number of transactions.
·
To verify the success of the above operations
open the jar file again and check if the properties file has the values set.
Enabling Curl extensions
The curl extension
files are
- libeay32.dll
- ssleay32.dll
These files should
be present in to C:\WINDOWS\system32
and Php installation directory.
Open the php.ini file from PHP installation
directory remove the semicolon of extension=php_curl.dll.
Disabling mcrypt extensions (for PHP version <= 4.4.4)
- Open the php.ini file from PHP installation directory add the semicolon on start of line ;extension=php_mcrypt.dll (if semicolon not present).
Checklist
·
Merchant should have
access to ePG over https
·
Check connectivity
between php
1.
Restart the IIS Server
2.
Browse the
testjava.php page either from browser of from IIS as shown below
i. Url : http://localhost/Merchant_Site_Name/test.php
Transaction Testing
·
Restart the Apache
·
Open the PHP page
either from browser or from Apache
·
If Merchant is SSL
then open TestSsl.php else if Merchant is Moto then TestMoto.php
1.
From IIS
2. From Browser
·
Type the URL :
http://localhost/Merchant_Site_name/TestSsl.php
Troubleshooting
Problem : In log file if you
got SSL certificate problem….
Solution : Add the
certificate CSR in \Sfa\cacerts.pem file. (Refer Adding Certificates in Cacerts
section).