@@ -794,17 +794,26 @@ public function fcpoGetActiveThemePath() {
794
794
*/
795
795
public function getHashELVWithChecktype ()
796
796
{
797
- $ sHash = md5 (
797
+ $ oConfig = $ this ->_oFcpoHelper ->fcpoGetConfig ();
798
+ $ sFCPOHashMethod = $ oConfig ->getConfigParam ('sFCPOHashMethod ' );
799
+ $ sKey = $ this ->getPortalKey ();
800
+
801
+ $ sData =
798
802
$ this ->getSubAccountId () .
799
- $ this ->getChecktype () .
800
- $ this ->getEncoding () .
801
- $ this ->getMerchantId () .
802
- $ this ->_getOperationModeELV () .
803
- $ this ->getPortalId () .
804
- 'bankaccountcheck ' .
805
- 'JSON ' .
806
- $ this ->getPortalKey ()
807
- );
803
+ $ this ->getChecktype () .
804
+ $ this ->getEncoding () .
805
+ $ this ->getMerchantId () .
806
+ $ this ->_getOperationModeELV () .
807
+ $ this ->getPortalId () .
808
+ 'bankaccountcheck ' .
809
+ 'JSON ' ;
810
+
811
+ $ sHashMD5 = md5 ($ sData .$ sKey );
812
+ $ sHashSha2 = hash_hmac ('sha384 ' , $ sData , $ sKey );
813
+
814
+ $ sHash = ($ sFCPOHashMethod == 'sha2-384 ' )
815
+ ? $ sHashSha2 : $ sHashMD5 ;
816
+
808
817
return $ sHash ;
809
818
}
810
819
@@ -815,16 +824,25 @@ public function getHashELVWithChecktype()
815
824
*/
816
825
public function getHashELVWithoutChecktype ()
817
826
{
818
- $ sHash = md5 (
827
+ $ oConfig = $ this ->_oFcpoHelper ->fcpoGetConfig ();
828
+ $ sFCPOHashMethod = $ oConfig ->getConfigParam ('sFCPOHashMethod ' );
829
+ $ sKey = $ this ->getPortalKey ();
830
+
831
+ $ sData =
819
832
$ this ->getSubAccountId () .
820
- $ this ->getEncoding () .
821
- $ this ->getMerchantId () .
822
- $ this ->_getOperationModeELV () .
823
- $ this ->getPortalId () .
824
- 'bankaccountcheck ' .
825
- 'JSON ' .
826
- $ this ->getPortalKey ()
827
- );
833
+ $ this ->getEncoding () .
834
+ $ this ->getMerchantId () .
835
+ $ this ->_getOperationModeELV () .
836
+ $ this ->getPortalId () .
837
+ 'bankaccountcheck ' .
838
+ 'JSON ' ;
839
+
840
+ $ sHashMD5 = md5 ($ sData .$ sKey );
841
+ $ sHashSha2 = hash_hmac ('sha384 ' , $ sData , $ sKey );
842
+
843
+ $ sHash = ($ sFCPOHashMethod == 'sha2-384 ' )
844
+ ? $ sHashSha2 : $ sHashMD5 ;
845
+
828
846
return $ sHash ;
829
847
}
830
848
0 commit comments