Skip to content

Commit

Permalink
Merge pull request #18 from paynl/feature/PLUG-463
Browse files Browse the repository at this point in the history
feature/PLUG-463
  • Loading branch information
woutse authored Jul 27, 2021
2 parents 2265dd9 + 3ecf0f9 commit ce5cd7f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
11 changes: 11 additions & 0 deletions upload/Pay/Api/Start.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Pay_Api_Start extends Pay_Api {
private $_object;
private $_domainId;
private $_transferData;

private $_testmode;

private $_products = array();

Expand All @@ -46,6 +48,11 @@ public function setObject($object){
public function setTransferData($transferData){
$this->_transferData = $transferData;
}

public function setTestmode($testmode){
$this->_testmode = $testmode;
}

/**
* Add a product to an order
* Attention! This is purely an adminstrative option, the amount of the order is not modified.
Expand Down Expand Up @@ -236,6 +243,10 @@ protected function _getPostData() {
$data['transaction']['currency'] = $this->_currency;
}

if (!empty($this->_testmode)){
$data['testMode'] = $this->_testmode;
}



if (!empty($this->_paymentOptionSubId)) {
Expand Down
4 changes: 4 additions & 0 deletions upload/Pay/Controller/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function index()
$settingsGeneral = array(
'payment_paynl_general_apitoken' => $settings['payment_'.$this->_paymentMethodName.'_apitoken'],
'payment_paynl_general_serviceid' => $settings['payment_'.$this->_paymentMethodName.'_serviceid'],
'payment_paynl_general_testmode' => $settings['payment_'.$this->_paymentMethodName.'_testmode'],
'payment_paynl_general_gateway' => trim($settings['payment_'.$this->_paymentMethodName.'_gateway'])

);
Expand All @@ -66,6 +67,9 @@ public function index()
if(!isset($data['serviceid']) || empty($data['serviceid'])){
$data['serviceid'] = $this->config->get('payment_paynl_general_serviceid');
}
if(!isset($data['testmode']) || empty($data['testmode'])){
$data['testmode'] = $this->config->get('payment_paynl_general_testmode');
}
if(!isset($data['gateway']) || empty($data['gateway'])){
$data['gateway'] = $this->config->get('payment_paynl_general_gateway');
}
Expand Down
1 change: 1 addition & 0 deletions upload/Pay/Controller/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function startTransaction()
$apiStart = new Pay_Api_Start();
$apiStart->setApiToken($this->config->get('payment_' . $this->_paymentMethodName . '_apitoken'));
$apiStart->setServiceId($this->config->get('payment_' . $this->_paymentMethodName . '_serviceid'));
$apiStart->setTestmode($this->config->get('payment_paynl_general_testmode'));

if (!empty(trim($this->config->get('payment_paynl_general_gateway')))){
$apiStart->setApiBase(trim($this->config->get('payment_paynl_general_gateway')));
Expand Down
3 changes: 3 additions & 0 deletions upload/admin/language/en-gb/extension/payment/paynl3.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
$_['text_display_icon'] = 'Display icon';
$_['text_display_icon_tooltip'] = 'Select if you want to display an icon and the size';

$_['text_testmode'] = 'Testmode';
$_['text_testmode_tooltip'] = 'Enable or disable test mode to test the exchanges between PAY. and your webshop';

$_['text_status_pending']='Order status pending payment';
$_['text_status_pending_tooltip']='The status of the order when the payment is started, but not yet completed';
$_['text_status_complete']='Order status payment successful';
Expand Down
3 changes: 3 additions & 0 deletions upload/admin/language/nl-nl/extension/payment/paynl3.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
$_['text_display_icon'] = 'Icoon weergeven';
$_['text_display_icon_tooltip'] = 'Selecteer hier of je een icoon wilt weergeven en welke grootte.';

$_['text_testmode'] = 'Testmode';
$_['text_testmode_tooltip'] = 'Zet de testmode aan of uit om de exchanges te testen tussen PAY. en uw webshop';

$_['text_status_pending']='Order status wacht op betaling';
$_['text_status_pending_tooltip']='De status van de order wanneer de betaling is gestart, maar nog niet afgerond';
$_['text_status_complete']='Order status betaling voltooid';
Expand Down
19 changes: 19 additions & 0 deletions upload/admin/view/template/extension/payment/paynl3.twig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@
{% endif %}
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"
for="{{ payment_method_name }}_testmode">
<span data-toggle="tooltip" title="{{ text_testmode_tooltip }}">
{{ text_testmode }}
</span></label>
<div class="col-sm-10">
<select name="{{ payment_method_name }}_testmode"
id="{{ payment_method_name }}_testmode" class="form-control">
{% if testmode %}
<option value="1" selected="selected">{{ text_enabled }}</option>
<option value="0">{{ text_disabled }}</option>
{% else %}
<option value="1">{{ text_enabled }}</option>
<option value="0" selected="selected">{{ text_disabled }}</option>
{% endif %}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"
for="{{ payment_method_name }}_gateway">
Expand Down

0 comments on commit ce5cd7f

Please sign in to comment.