Skip to content
This repository was archived by the owner on May 11, 2023. It is now read-only.

Commit 3fe96fa

Browse files
authored
Merge pull request #7 from paynl/feature/PLUG-325
Feature/plug 325
2 parents f5b75f1 + 94683ac commit 3fe96fa

6 files changed

Lines changed: 18 additions & 10 deletions

File tree

Pay/Api/Start.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Pay_Api_Start extends Pay_Api {
77
protected $_action = 'start';
88
private $_amount;
99
private $_currency;
10+
private $_orderNumber;
1011
private $_paymentOptionId;
1112
private $_paymentOptionSubId;
1213
private $_finishUrl;
@@ -30,6 +31,9 @@ class Pay_Api_Start extends Pay_Api {
3031
public function setCurrency($currency){
3132
$this->_currency = $currency;
3233
}
34+
public function orderNumber($orderNumber){
35+
$this->_orderNumber = $orderNumber;
36+
}
3337
public function setPromotorId($promotorId){
3438
$this->_promotorId = $promotorId;
3539
}
@@ -233,6 +237,11 @@ protected function _getPostData() {
233237
if (!empty($this->_currency)) {
234238
$data['transaction']['currency'] = $this->_currency;
235239
}
240+
if (!empty($this->_orderNumber)) {
241+
$data['transaction']['orderNumber'] = $this->_orderNumber;
242+
}
243+
244+
236245

237246

238247

Pay/Controller/Payment.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,9 @@ public function startTransaction() {
5959

6060
$apiStart->setFinishUrl($returnUrl);
6161
$apiStart->setExchangeUrl($exchangeUrl);
62-
63-
6462
$apiStart->setPaymentOptionId($this->_paymentOptionId);
6563

66-
$currency_amount = $this->currency->format($order_info['total'], $order_info['currency_code'], '', false);
67-
64+
$currency_amount = $this->currency->format($order_info['total'], $order_info['currency_code'], '', false);
6865
$amount = round($currency_amount * 100);
6966
$apiStart->setAmount($amount);
7067

@@ -75,10 +72,12 @@ public function startTransaction() {
7572
$optionSub = $_POST['optionSubId'];
7673
$apiStart->setPaymentOptionSubId($optionSub);
7774
}
75+
76+
$apiStart->orderNumber($order_info['order_id']);
7877
$apiStart->setDescription($order_info['order_id']);
7978
$apiStart->setExtra1($order_info['order_id']);
80-
$apiStart->setObject('opencart1 3.4.6');
81-
79+
$phpVersion = substr(phpversion(), 0, 3);
80+
$apiStart->setObject(substr('opencart1 3.4.7 | ' . VERSION . ' | ' . $phpVersion, 0, 64));
8281

8382
// Klantdata verzamelen en meesturen
8483
$strAddress = $order_info['shipping_address_1'] . ' ' . $order_info['shipping_address_2'];

admin/controller/payment/paynl_klarnakp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
require_once $autoload;
66
class ControllerPaymentPaynlKlarnakp extends Pay_Controller_Admin {
7-
protected $_paymentOptionId = 2265;
7+
protected $_paymentOptionId = 1717;
88
protected $_paymentMethodName = 'paynl_klarnakp';
99

1010
protected $_defaultLabel = 'KlarnaKP';

admin/language/dutch/payment/paynl3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$_['button_save'] = 'Opslaan';
55
$_['button_cancel'] = 'Annuleren';
66

7-
$version = '3.4.6';
7+
$version = '3.4.7';
88
$css = 'position: relative;top: -19px;display: inline;left: 10px;';
99
$url = '<a href="https://www.pay.nl" target="_blank"><img src="https://static.pay.nl/generic/images/50x50/logo.png" alt="PAY." title="PAY."/></a>' .
1010
'<div style="' . $css . '">Version: ' . $version . '</div>';

admin/language/english/payment/paynl3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$_['button_save'] = 'Save';
55
$_['button_cancel'] = 'Cancel';
66

7-
$version = '3.4.6';
7+
$version = '3.4.7';
88
$css = 'position: relative;top: -19px;display: inline;left: 10px;';
99
$url = '<a href="https://www.pay.nl" target="_blank"><img src="https://static.pay.nl/generic/images/50x50/logo.png" alt="PAY." title="PAY."/></a>' .
1010
'<div style="' . $css . '">Version: ' . $version . '</div>';

catalog/controller/payment/paynl_klarnakp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
require_once $autoload;
66
class ControllerPaymentPaynlKlarnakp extends Pay_Controller_Payment {
7-
protected $_paymentOptionId = 2265;
7+
protected $_paymentOptionId = 1717;
88
protected $_paymentMethodName = 'paynl_klarnakp';
99

1010
}

0 commit comments

Comments
 (0)