Skip to content

Commit a098e20

Browse files
committed
Correct signature of signMerchantRequest
1 parent 61600e2 commit a098e20

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Trustly/Api/signed.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ public function useMerchantPrivateKey($cert) {
124124
* @throws Trustly_SignatureException if private key has not been loaded
125125
* yet or if we for some other reason fail to sign the request.
126126
*
127-
* @param Trustly_Data_JSONRPCRequest $request Request to sign.
127+
* @param Trustly_Data_JSONRPCRequest|Trustly_Data_JSONRPCNotificationResponse $request Request to sign.
128+
*
129+
* @return string
128130
*/
129131
public function signMerchantRequest($request) {
130132
if(!isset($this->merchant_privatekey)) {
@@ -166,9 +168,6 @@ protected function insertCredentials($request) {
166168
$request->setData('Password', $this->api_password);
167169

168170
$signature = $this->signMerchantRequest($request);
169-
if($signature === FALSE) {
170-
return FALSE;
171-
}
172171
$request->setParam('Signature', $signature);
173172

174173
return TRUE;
@@ -223,9 +222,6 @@ public function notificationResponse($request, $success=TRUE) {
223222
$response = new Trustly_Data_JSONRPCNotificationResponse($request, $success);
224223

225224
$signature = $this->signMerchantRequest($response);
226-
if($signature === FALSE) {
227-
return FALSE;
228-
}
229225
$response->setSignature($signature);
230226

231227
return $response;

0 commit comments

Comments
 (0)