Skip to content

Commit

Permalink
Updated objectinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
woutse committed Feb 22, 2021
1 parent 4cd2dbe commit 368d49e
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions paynlpaymentmethods/paynlpaymentmethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -725,16 +725,7 @@ public function startPayment(Cart $cart, $payment_option_id, $extra_data = array
$description = Configuration::get('PAYNL_DESCRIPTION_PREFIX') . $description;
}

$object_string = 'prestashop ';
if(isset($this->version) && !empty($this->version)){
$object_string .= $this->version;
}
if(defined('_PS_VERSION_') && !empty(_PS_VERSION_)){
$object_string .= ' | ' . _PS_VERSION_;
}
if(defined('PHP_VERSION') && !empty(PHP_VERSION)){
$object_string .= ' | ' . PHP_VERSION;
}


$startData = array(
'amount' => $cart->getOrderTotal(true, Cart::BOTH, null, null, false),
Expand All @@ -746,7 +737,7 @@ public function startPayment(Cart $cart, $payment_option_id, $extra_data = array
'testmode' => Configuration::get('PAYNL_TEST_MODE'),
'extra1' => $cart->id,
'products' => $products,
'object' => substr($object_string, 0, 64),
'object' => $this->getObjectInfo()
);

$addressData = $this->_getAddressData($cart);
Expand Down Expand Up @@ -798,6 +789,21 @@ public function startPayment(Cart $cart, $payment_option_id, $extra_data = array
return $payTransaction->getRedirectUrl();
}

/**
* @return false|string
*/
private function getObjectInfo()
{
$object_string = 'prestashop | ';
$object_string .= !empty($this->version) ? $this->version : '-';
$object_string .= ' | ';
$object_string .= defined('_PS_VERSION_') ? _PS_VERSION_ : '-';
$object_string .= ' | ';
$object_string .= substr(phpversion(), 0, 3);

return substr($object_string, 0, 64);
}

/**
* Retrieve the settings of a specific payment with payment_profile_id
*
Expand Down

0 comments on commit 368d49e

Please sign in to comment.