Article ID: 9500, created on Dec 27, 2010, last review on May 7, 2014

  • Applies to:
  • Plesk 10.x for Linux
  • Plesk 10.x for Windows

Symptoms

All payments through the BancaSella payment gateway remain in status Processing.

Cause

When you configure the BancaSella payment gateway, one of the steps is to set a callback URL to which the gateway will send statuses of transactions. BancaSella does not accept ports in URLs, and will not send callbacks to Parallels Customer and Business Manager as the latter utilizes port 8443. Having no callbacks, Parallels Customer and Business Manager will be unable to change transaction statuses.

Resolution

We offer the code that receives BancaSella callbacks and forwards them to an appropriate Parallels Customer and Business Manager endpoint. This code requires PHP 5.x to run. You should put this code to the location that does not contain port numbers and is accessible from remote.  When ready, specify this new location as a callback URL in BancaSella.
 
To set this location up,  we recommend that you do one of the following:

* Configure a virtual host on the default port
* Install another HTTP server
* Map port 8443 to 80 (the default port)
 
Before you put the code to the location, customize it to your system by substituting <parallels_plesk_host> with the host name of Parallels Customer and Business Manager.
 
<?php
 
define("HSPC_CALLBACK_URL", "https://<parallels_plesk_host>:8443/plesk-billing/lib-mbapi/include/modules/gateway/return/HSPCCallback.php");
 
try {
    // following can be skipped if you are configuring callback on Unix.
    if ((! isset($_SERVER["REQUEST_URI"]) || empty($_SERVER["REQUEST_URI"])) && 0 > preg_match("/microsoft\-iis/i", strtolower($_SERVER["SERVER_SOFTWARE"]))) {
        $_SERVER["REQUEST_URI"] = $_SERVER["SCRIPT_NAME"];
        if ($_SERVER["QUERY_STRING"]) {
            $_SERVER["REQUEST_URI"] .= "?{$_SERVER['QUERY_STRING']}";
        }
    }
 
    $options = array(
        CURLOPT_POST => 1,
        CURLOPT_HEADER => 0,
        CURLOPT_URL => HSPC_CALLBACK_URL . $_SERVER["REQUEST_URI"],
        CURLOPT_FRESH_CONNECT => 1,
        CURLOPT_RETURNTRANSFER => 1,
        CURLOPT_FORBID_REUSE => 1,
        CURLOPT_TIMEOUT => 60,
        CURLOPT_POSTFIELDS => http_build_query($_POST),
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_SSL_VERIFYHOST => 2,
    );
    echo HSPC_CALLBACK_URL . $_SERVER["REQUEST_URI"];
    $c = curl_init();
    curl_setopt_array($c, $options);
    $output = (false === $output = curl_exec($c)) ? curl_error($c) : $output;
    curl_close($c);
} catch (Exception $e) {
    $output = $e->getMessage();
}
 
echo $output;
 
?>

dd0611b6086474193d9bf78e2b293040 a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 c796c01d6951fa24ed54c7f1111667c6 85a92ca67f2200d36506862eaa6ed6b8 56797cefb1efc9130f7c48a7d1db0f0c

Email subscription for changes to this article
Save as PDF