Skip to content

Commit 99dbe18

Browse files
committed
Bugfix for w7corp#359
1 parent f3a4328 commit 99dbe18

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Payment/Payment.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ public function configForShareAddress($accessToken, $json = true)
187187
'accesstoken' => $accessToken,
188188
];
189189

190-
$params['addrSign'] = generate_sign($signParams, $this->merchant->key, 'sha1');
190+
ksort($signParams);
191+
192+
$params['addrSign'] = sha1(urldecode(http_build_query($signParams)));
191193

192194
return $json ? json_encode($params) : $params;
193195
}

src/Payment/helpers.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function generate_sign(array $attributes, $key, $encryptMethod = 'md5')
3838
return strtoupper(call_user_func_array($encryptMethod, [urldecode(http_build_query($attributes))]));
3939
}
4040

41+
4142
/**
4243
* Get client ip address.
4344
*

0 commit comments

Comments
 (0)