You are on page 1of 7

Checksum Document for PHP

Transaction Detail Checksum Facility On Payment Gateway Provided By TechProcess Solutions Ltd TPSL has checksum facility for rovidin! security at transaction time" This is one of the ty es of inte!ration we have" #n this ty e of inte!ration$ TPSL will rovide %P# to the merchant$ what they have to de loy at their end" % checksum value will &e !enerated usin! this %P#" Please find the &elow mentioned detailed rocess"

Process for Checksum


'" )" +" ," (erchant has to de loy the %P# !iven &y TPSL at their end" %ll the necessary re*uest arameter will &e send to this %P#" This %P# will !enerate a checksum value" %t the re*uest time this checksum value will come to TPSL-s end with re*uest arameter as er Annexure 01" ." /hen re*uest will reach TPSL-s side TPSL will once a!ain !enerate the checksum value usin! the re*uest arameter received from the (erchant" 0" #f the value of the checksum matches at &oth the end$ then the transaction will &e forwarded to the res ective &ank" 1" Once TPSL receives the res onse from the &ank$ TPSL !enerate checksum value with the res onse arameter that will &e sent to the merchant" 2" Once TPSL send the res onse to the merchant alon! with the checksum value$ merchant will !enerate checksum usin! the res onse arameter received from TPSL" 3" #f checksum value matches at merchant side usin! %P# then that transaction will return as a Transaction Success" %fter that to check auth status as er anne4ure 5+6#f auth status75+55 is for success transaction or auth status75+33 is for failed transactions '5" #f checksum mismatches$ that transaction will &e considered as Failed8Fraud transaction" Technical Process Flow6 '" (erchant has to share the re*uest 9:L ;From which the transaction re*uest will come< with TPSL"TPSL will confi!ure the same at TPSL end and validate transaction time for security ur ose" )" (erchant can hit the &elow 9:L for Transaction Processin! Testing6 htt s688www"tek rocess"co"in8PaymentGateway8Transaction:e*uest"=s > ms!7?@str(s!

Live6 htt s688www"t slAindia"in8PaymentGateway8Transaction:e*uest"=s > ms!7?@str(s!


Pre-requisites: 1. PHP 5 or greater 2. cUrl 1. Step 1: Files and Directory Verification 1.1. Please make sure total 5 files are provided to you. (Request.php, getcheck.php, 1.2. Respo se.php, keystoretechp.pem a d !ercha t"etails.properties# 1.$. !ake sure these files are placed u der same directory e%cept MerchantDetails.properties. 1.&. 't is ot compulsory to place files u der directory provided (y )echprocess. 1.5. Please assure follo*i g values are availa(le i side !ercha t"etails.properties file. 1.5.1. +iller'd, -Represe t the !ercha t '" provided (y )P./.0 1.5.2. Respo seUrl, -Represe t the Respo se UR/ of mercha t.0 1.5.$. 1R2, -1urre cy.0 1.5.&. 1heck.um3ey, -U ique key provided (y )P./.0 1.5.5. 1heck.um4e Url, -UR/ provided (y )P./.0 1.5.5. )P./Url, -)P./ Payme t gate*ay UR/.0 2. Step 2: Implementation 2.1. !ake sure MerchantDetails.properties file is ot accessi(le from (ro*ser. 2.2. 6or testi g default UR/ *ill (e prese t for 7)P./Url,8 i MerchantDetails.properties file. 2.$. 9ou ca cha ge this UR/ o ce you get the e* UR/ from )P./ for /ive )ra sactio s. 2.&. 1ha ge the follo*i g i MerchantDetails.properties *ith the details )P./ have provided. 2.5. !ake sure there should ot (e a y spaces at the (egi i g a d the e d of each value of 2.5. MerchantDetails.properties. 6ollo* .cree :1

Screen: 1

;.1. 1opy 7Request.php8,8getcheck.php8, 7Respo se.php8 a d 7keystoretechp.pem8 to the desired directory. 2.<. =pe 7getcheck.php8 a d cha ge the Property file path to the path *here you have placed your property file. !ake similar cha ge i 7Respo se.php8. 6ollo* .cree :2.

Screen: 2

2.>.

2o*, look for curl!setopt"#ch$ %&'()P*!'+F+'+'$,http:--....yourdomain.com-filename.php,/01 li e a d cha ge the UR/ to *here your getcheck.php a d Respo se.php file is placed. !ake sure you replace the file ame.php *ith the respected file ames. e.g. 6or getcheck.php:
curl!setopt"#ch$ %&'()P*!'+F+'+'$,http:--....yourdomain.com-2etchec3.php,/0

6or respo se.php:


curl!setopt"#ch$ %&'()P*!'+F+'+'$,http:--....yourdomain.com-'esponse.php,/0

4. Step 4: Important thin2s to remem5er. $.1 "o ot modify 7keystoretechp8 file. $.2 "o ot modify a y code i a y of the file. $.$ )o get respo se values, you ca check 7Respo se.php8 file. "o ot (ypass a y of the procedure from 7Respo se.php8 file. $.& U der respo se.php you *ill get follo*i g array o ce the tra sactio do e.
[0] => T1234 [Biller Id] [1] => 1 [Transaction ID] [2] => 00 [3] => NA [4] => 1 [Amount] [5] => 470 [Ban code] [!] => NA [7] => NA ["] => IN# [$] => NA [10] => NA [11] => NA [12] => NA [13] => 1"%07%2011 10&12&1" [Timestam'] [14] => 03$$ [(ould )e 0300*03$$] 0300& +uccess transaction, 03$$& -ailed transaction, [15] => NA [1!] => 1 [.ar et code] [17] => 1 [Account Num)er] [1"] => NA [1$] => NA [20] => NA [21] => NA [22] => NA [23] => NA

[24] => NA [25] => 2$2!$7030$25

$.& Please remem(er i tegratio *ill (e ha dled i t*o *ays. a# )est server tra sactio . (# /ive server tra sactio . 6or (oth types you eed to perform co figuratio i same files?fields *hich are provided to you. 'equest.php: "o ot require a y ki d of co figuratio . 2etchec3.php: 1o figuratio required. 'esponse.php: 1o figuratio required. MerchantDetails.properties: 1o figuratio required. 6eystorete3p.pem: "o ot require a y ki d of co figuratio . %onfi2uration 'equired in Files 'e7ised for 5oth types getcheck.php: i. .et property file path. ii. .et curl@opt RA6ARAR path to your domai ame. iii. .et curl@opt 1UR/=P)@1B'26= path to the certificate *hich is provided to you. Please ote )est a d /ive certificates are differe t. Respo iv. v. vi. se.php: .et property file path. .et curl@opt RA6ARAR path to your domai ame. .et curl@opt 1UR/=P)@1B'26= path to the certificate *hich is provided to you. Please ote )est a d /ive certificates are differe t.

!ercha t"etails.properties: vii. 1ha ge +iller'" to the o e provided to you. viii. 1ha ge Respo seurl to the o e *here your Respo se.php file is located. i%. 1ha ge 1heck.um3ey to the o e *hich is provided to you. %. 1ha ge 1heck.um4e Url *he /ive UR/ is provided to you. %i. 1ha ge )P./Url *he /ive UR/ is provided to you.

For more details related to 'equest and 'esponse please refer 8nne9ure. 8nne9ure :1: 1hecksum Request Parameter (6rom !ercha t to )P./# Paramete r )ra sactio 'd !arket 1ode Sampl e Value 12$&55 5 12$& Si;e < (stri g# 1C (.tri g# *ype !a datory !a datory Description !AR1HB2) u ique refere ce um(er +9tra information from merchant for product details .ith alphanumeric plus

<!= Bccou t 2o 12$D $$&&&& )' 1 5CC.CC $CC ":FF)ec hProce ssFFPro pertyFF !ercha t"etai ls@)11 >>.pro perties 2CC (.tri g# < 5 (.tri g# 15C (.tri g# !a datory 't *ill (e accou t um(er of customer provided (y !AR1HB2) or if !AR1HB2) do Et *a t to pass accou t o the they eed to pass co sta t value as 1. 't *ill (e tra sactio amou t 't *ill (e (a k 1ode as per 8nne9ure :>. !ercha t eeds to pass the complete or relative path of the property file residi g i the system.

Payme t Bmou t +a k 1ode Property file path

!a datory !a datory !a datory

8nne9ure :2: 1hecksum Respo se Parameter (6rom )P./ to !ercha t# Parameter !AR1HB2) '" 1ustomer'" )% refere ce2o +a kRefere ce2o Sample Value /12$ ><;12$&55; 2B 2B Si;e 5 2C 2B 2B *ype 1haracter varchar 2B 2B Description !AR1HB2) id provided (y )P./ to !AR1HB2). !AR1HB2) u ique tra sactio id. )P./ u ique tra sactio '" +a ks u ique tra sactio '". )ra sactio Bmou t provided (y !AR1HB2) (.R1 B!) field i )P./ system#. +a k 'd provided (y )P./. 't *ill (e !AR1HB2) id of !AR1HB2) provided (y (a k (provided (y (a k#. 6or rest (a ks, it *ill (e 72B8. )his *ill (e 72B8 al*ays. )his *ill (e 7'2R8 al*ays. )his *ill (e 72B8 al*ays. )his *ill (e 72B8 al*ays. )his *ill (e 72B8 al*ays.

)% Bmou t +a k'"

;CC $CC

15 $

Garchar 2umeric

+a k!AR1HB2)'"

2B

2B

2B

)% )ype 1urre cy 2ame 'tem 1ode .ecurity )ype .ecurity '"

2B '2R 2B 2B 2B

2B $ 2B 2B 2B

2B Garchar 2B 2B 2B

.ecurity Pass*ord )% "ate Buth .tatus .ettleme t )ype Bdditio al' fo1 Bdditio al' fo2 Bdditio al' fo$ Bdditio al' fo& Bdditio al' fo5 Bdditio al' fo5 Bdditio al' fo; Arror.tatus Arror "escriptio 1heck.um

2B "ate

2B 2C

2B "ate 6ormat ""D !!D9999 HH:!!:..

)his *ill (e 72B8 al*ays. )ime a d date at *hich )P./ se ds respo se. 6ormat is ""D!!D9999 HH:!!:.. Refer 8nne9ure :4

2B ;C;2CC5 1C2D 1C2>;5$>5 2B 2B 2B 2B 2B 2B 2B or %%% 12$&55;<>

2B 2C 1CC 2B 2B 2B 2B 2B 2B 1CC 5C

2B Garchar Garchar "ate Garchar Garchar Garchar Garchar 2B 2B or Garchar Garchar

)his *ill (e 72B8 al*ays. )his *ill (e market code. )his *ill (e accou t um(er. )his *ill (e 72B8 al*ays. )his *ill (e 72B8 al*ays. )his *ill (e 72B8 al*ays. )his *ill (e 72B8 al*ays. )his *ill (e 72B8 al*ays. )his *ill (e 72B8 al*ays )his *ill (e either 72B8 or respective error messages. )his *ill (e u ique checksum um(er as per logic.

?ote: %hec3sum that are 2enerated is 12 di2it num5er. 8nne9ure :4: 8&*@S*8*&S HC$CCH HC$>>H Status 'eason .uccess ' valid Buthe ticatio +a k Proposed *ransaction .uccessful )ra sactio 1a cel )ra sactio

at

You might also like