Skip to content

Commit

Permalink
Merge pull request #3 from paynl/feature/PLUG-3351
Browse files Browse the repository at this point in the history
PLUG-3351 - Updated url prefix
  • Loading branch information
woutse authored Apr 11, 2024
2 parents 72eb458 + 22f7c3d commit d1b5a11
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 42 deletions.
2 changes: 1 addition & 1 deletion sites/all/modules/paynl/includes/classes/Pay/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Pay_Api {
const REQUEST_TYPE_POST = 1;
const REQUEST_TYPE_GET = 0;

protected $_apiUrl = 'http://rest-api.pay.nl';
protected $_apiUrl = 'https://rest-api.pay.nl';
protected $_version = 'v3';
protected $_controller = '';
protected $_action = '';
Expand Down
41 changes: 1 addition & 40 deletions sites/all/modules/paynl/includes/classes/Pay/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,46 +54,7 @@ public static function filterArrayRecursive($array) {
}
}
return $newArray;
}

/**
* Find out if the connection is secure
*
* @return boolean Secure
*/
public static function isSecure() {
$isSecure = false;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$isSecure = true;
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
$isSecure = true;
}
return $isSecure;
}
public static function getUri(){
if(self::isSecure()){
$uri='https://';
} else {
$uri='http://';
}

$uri .= $_SERVER['SERVER_NAME'];

if(!empty($_SERVER['REQUEST_URI'])){
$uri .= $_SERVER['REQUEST_URI'];
$uriDir = $uri;
if(substr($uri, -4) == '.php'){
$uriDir = dirname($uri);
}


if($uriDir != 'http:' && $uriDir != 'https:'){
$uri = $uriDir;
}
}

return $uri.'/';
}
}

public static function sortPaymentOptions($paymentOptions){
uasort($paymentOptions, 'sortPaymentOptions');
Expand Down
2 changes: 1 addition & 1 deletion sites/all/modules/paynl/paynl.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function paynl_place_order( $order, $methodId )

//save the cubecart orderid so we can refer to this when the pay.nl exchange pings back
$objStartApi->setExtra1( $order->order_id );
$objStartApi->setObject('ubercart 1.1.1');
$objStartApi->setObject('ubercart 1.1.2');

//create transaction
$arrTransaction = $objStartApi->doRequest();
Expand Down

0 comments on commit d1b5a11

Please sign in to comment.