File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function getData(): array
2828
2929 $ parameters = $ this ->getParameters ();
3030 $ parameters ['vnp_SecureHash ' ] = $ this ->generateSignature (
31- $ parameters ['vnp_SecureHashType ' ] = 'SHA256 '
31+ $ parameters ['vnp_SecureHashType ' ] = 'md5 '
3232 );
3333
3434 unset($ parameters ['vnp_HashSecret ' ], $ parameters ['testMode ' ]);
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ trait RequestSignature
2121 * @param string $hashType
2222 * @return string
2323 */
24- protected function generateSignature ($ hashType = 'sha256 ' ): string
24+ protected function generateSignature ($ hashType = 'md5 ' ): string
2525 {
2626 $ data = [];
2727 $ signature = new Signature (
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class Signature
3636 * @param string $hashType
3737 * @throws InvalidArgumentException
3838 */
39- public function __construct (string $ hashSecret , string $ hashType = 'sha256 ' )
39+ public function __construct (string $ hashSecret , string $ hashType = 'md5 ' )
4040 {
4141 if (! $ this ->isSupportHashType ($ hashType )) {
4242 throw new InvalidArgumentException (sprintf ('Hash type: `%s` is not supported by VNPay ' , $ hashType ));
@@ -57,9 +57,7 @@ public function generate(array $data): string
5757 ksort ($ data );
5858 $ dataSign = $ this ->hashSecret .urldecode (http_build_query ($ data ));
5959
60- return strtoupper (
61- hash ($ this ->hashType , $ dataSign )
62- );
60+ return hash ($ this ->hashType , $ dataSign );
6361 }
6462
6563 /**
You can’t perform that action at this time.
0 commit comments