Skip to content

Commit

Permalink
Add type & version to svea Reference
Browse files Browse the repository at this point in the history
  • Loading branch information
albtje committed Aug 22, 2019
1 parent 4f5433b commit bd065a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected function _setupOrderConfig($sveaOrder, $quote)
//To avoid order already being created, if you for example have
//stageEnv/devEnv and ProductionEnv with quote id in same range.
$allowedLength = 32;
$separator = '_';
$separator = '_q_m1_';
$lengthOfHash = $allowedLength - (strlen((string)$quoteId) + strlen($separator));
$hashedBaseUrl = sha1(Mage::getBaseUrl());
$clientId = $quoteId . $separator . mb_substr($hashedBaseUrl, 0, $lengthOfHash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function acknowledge($quote, $mode, $sveaId)
$useForReference = Mage::getStoreConfig('payment/sveacheckout_dev_settings/reference');
if (in_array($useForReference , ['suffixed-increment-id','suffixed-order-id'])) {
$reference = $sveaReference;
$separator = '_';
$separator = '_o_m1_';
$lastChar = strrpos ($reference , $separator,0);
$reference = substr($reference,0, $lastChar);
if ($useForReference == 'suffixed-increment-id') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected function _makeSveaOrderId($orderId)
//To avoid order already being created, if you for example have
//stageEnv/devEnv and ProductionEnv with quote id in same range.
$allowedLength = 32;
$separator = '_';
$separator = '_o_m1_';
$lengthOfHash = $allowedLength - (strlen((string)$reference) + strlen($separator));
$hashedBaseUrl = sha1(Mage::getBaseUrl());
$clientId = $reference . $separator . mb_substr($hashedBaseUrl, 0, $lengthOfHash);
Expand Down

0 comments on commit bd065a2

Please sign in to comment.