From 4f3db35bd394baa478c7913b6fc2256c4ec8f2ee Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Thu, 5 Nov 2020 13:59:45 +0100 Subject: [PATCH 1/2] Add additional information to Object --- paynlpaymentmethods/paynlpaymentmethods.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paynlpaymentmethods/paynlpaymentmethods.php b/paynlpaymentmethods/paynlpaymentmethods.php index 8266bc7..001403b 100644 --- a/paynlpaymentmethods/paynlpaymentmethods.php +++ b/paynlpaymentmethods/paynlpaymentmethods.php @@ -736,7 +736,7 @@ public function startPayment(Cart $cart, $payment_option_id, $extra_data = array 'testmode' => Configuration::get('PAYNL_TEST_MODE'), 'extra1' => $cart->id, 'products' => $products, - 'object' => 'prestashop '. $this->version, + 'object' => substr('prestashop '. $this->version . ' | ' . _PS_VERSION_ . ' | ' . PHP_VERSION, 0, 64), ); $addressData = $this->_getAddressData($cart); From 5de1e5490639909b33e606c582c7ba6aa1b5dc00 Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Thu, 5 Nov 2020 14:29:14 +0100 Subject: [PATCH 2/2] add check to variabels --- paynlpaymentmethods/paynlpaymentmethods.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/paynlpaymentmethods/paynlpaymentmethods.php b/paynlpaymentmethods/paynlpaymentmethods.php index 001403b..b5c5281 100644 --- a/paynlpaymentmethods/paynlpaymentmethods.php +++ b/paynlpaymentmethods/paynlpaymentmethods.php @@ -726,6 +726,17 @@ 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), 'currency' => $currency->iso_code, @@ -736,7 +747,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('prestashop '. $this->version . ' | ' . _PS_VERSION_ . ' | ' . PHP_VERSION, 0, 64), + 'object' => substr($object_string, 0, 64), ); $addressData = $this->_getAddressData($cart);