Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Trustly/Api/signed.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public function useMerchantPrivateKey($cert) {
* @throws Trustly_SignatureException if private key has not been loaded
* yet or if we for some other reason fail to sign the request.
*
* @param Trustly_Data_JSONRPCRequest $request Request to sign.
* @param Trustly_Data_JSONRPCRequest|Trustly_Data_JSONRPCNotificationResponse $request Request to sign.
*
* @return string
*/
public function signMerchantRequest($request) {
if(!isset($this->merchant_privatekey)) {
Expand Down Expand Up @@ -166,9 +168,6 @@ protected function insertCredentials($request) {
$request->setData('Password', $this->api_password);

$signature = $this->signMerchantRequest($request);
if($signature === FALSE) {
return FALSE;
}
$request->setParam('Signature', $signature);

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

$signature = $this->signMerchantRequest($response);
if($signature === FALSE) {
return FALSE;
}
$response->setSignature($signature);

return $response;
Expand Down