Skip to content

Commit

Permalink
Updated api
Browse files Browse the repository at this point in the history
  • Loading branch information
woutse committed Aug 10, 2021
1 parent 60837e2 commit a650f43
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
29 changes: 18 additions & 11 deletions upload/Pay/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,33 @@ public function setServiceId($serviceId) {
*
* @param string $apiToken
*/
public function setApiToken($apiToken) {
public function setApiToken($apiToken)
{
$this->_apiToken = $apiToken;
}

public function setApiBase($gateway){
$this->_gateway = $gateway;
public function setApiBase($gateway)
{
$this->_gateway = trim($gateway);
}

protected function _getPostData() {
protected function _getPostData()
{

return $this->_postData;
}

protected function _processResult($data) {
protected function _processResult($data)
{
return $data;
}

private function _getApiUrl() {
/**
* @return string
* @throws Pay_Exception
*/
private function _getApiUrl()
{
if ($this->_version == '') {
throw new Pay_Exception('version not set', 1);
}
Expand All @@ -61,11 +70,9 @@ private function _getApiUrl() {
throw new Pay_Exception('action not set', 1);
}

if (!empty(trim($this->_gateway))){
return $this->_apiUrl = trim($this->_gateway) . '/' . $this->_version . '/' . $this->_controller . '/' . $this->_action . '/json/';
} else{
return $this->_apiUrl . '/' . $this->_version . '/' . $this->_controller . '/' . $this->_action . '/json/';
}
$host = (!empty($this->_gateway) && substr($this->_gateway, 0, 4) === 'http') ? $this->_gateway : $this->_apiUrl;

return $host . '/' . $this->_version . '/' . $this->_controller . '/' . $this->_action . '/json/';
}

public function getPostData(){
Expand Down
2 changes: 1 addition & 1 deletion upload/Pay/Controller/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function startTransaction()
}
$apiStart->setDescription($order_info['order_id']);
$apiStart->setExtra1($order_info['order_id']);
$apiStart->setObject('opencart3 1.2.8');
$apiStart->setObject('opencart3 1.3.0');


// Klantdata verzamelen en meesturen
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/language/en-gb/extension/payment/paynl3.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

$_['text_extension'] = 'PAY.';

$version = '1.2.8';
$version = '1.3.0';
$css = 'position: relative;top:0px;display: inline;left: 10px;';
$paynl_logo = '<a href="https://www.pay.nl" target="paynl"><img src="https://static.pay.nl/generic/images/50x50/logo.png" alt="PAY." title="PAY." /></a>' .
'<div style="' . $css . '">Version: ' . $version . '</div>';;
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/language/nl-nl/extension/payment/paynl3.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

$_['text_extension'] = 'PAY.';

$version = '1.2.8';
$version = '1.3.0';
$css = 'position: relative;top:0px;display: inline;left: 10px;';
$paynl_logo = '<a href="https://www.pay.nl" target="paynl"><img src="https://static.pay.nl/generic/images/50x50/logo.png" alt="PAY." title="PAY." /></a>' .
'<div style="' . $css . '">Version: ' . $version . '</div>';;
Expand Down

0 comments on commit a650f43

Please sign in to comment.