Skip to content

Commit

Permalink
Minor fixes, test SHA512 for Coop
Browse files Browse the repository at this point in the history
  • Loading branch information
renekorss committed Mar 28, 2023
1 parent 1fe1ee1 commit 976ab3e
Show file tree
Hide file tree
Showing 8 changed files with 495 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/EE/CoopPank.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @link https://github.com/renekorss/Banklink/
*
* @author Rene Korss <rene.korss@gmail.com>
* @copyright 2016-2023 Rene Korss
* @copyright 2016-2020 Rene Korss
* @license MIT
*/
namespace RKD\Banklink\EE;
Expand Down Expand Up @@ -50,7 +50,7 @@ class CoopPank extends Banklink
protected $responseEncoding = 'ISO-8859-13';

/**
* Force Krediidipank class to use IPizza protocol.
* Force CoopPank class to use IPizza protocol.
*
* @param RKD\Banklink\Protocol\IPizza $protocol Protocol used
*/
Expand Down
21 changes: 21 additions & 0 deletions src/Protocol/IPizza.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,27 @@ protected function validateSignature(array $response, string $encoding = 'UTF-8'
return $this->result === 1;
}

/**
* Set version
*
* @param string
*/
public function setVersion($version) : self
{
$this->version = $version;
return $this;
}

/**
* Get version
*
* @param string
*/
public function getVersion() : string
{
return $this->version;
}

/**
* Set algorithm used to generate mac
*
Expand Down
2 changes: 1 addition & 1 deletion src/Protocol/IPizza2015.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct(
);

// Detect which service to use
if (strlen($sellerName) > 0 && strlen($sellerAccount) > 0) {
if (is_string($sellerName) && strlen($sellerName) > 0 && is_string($sellerAccount) && strlen($sellerAccount) > 0) {
$this->setServiceId(Services2015::PAYMENT_REQUEST_1001);
return;
}
Expand Down
14 changes: 14 additions & 0 deletions src/Response/PaymentResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ class PaymentResponse extends Response
*/
protected $currency;

/**
* Receiver data (name and account).
*
* @var object
*/
protected $receiver;

/**
* Sender data (name and account).
*
Expand All @@ -61,6 +68,13 @@ class PaymentResponse extends Response
*/
protected $transactionDate;

/**
* Message
*
* @var string
*/
protected $message;

/**
* Set order ID.
*
Expand Down
Loading

0 comments on commit 976ab3e

Please sign in to comment.