Secure-eBook

Secure-eBook Documentation

Allowing Proxy Settings through the Secure-eBook PHP SDK

Starting with version 1.1.0, the PHP SDK gives developers the opportunity to set up extra parameters to CURL, thereby allowing communications to go through a proxy server.

Subclassing SebSDK

In order to add your custom CURL settings, you will need to subclass the SDK class and override the setupCurl method.

Here is an example of subclassing SebSDK to create a custom 'MySebSDK' class that sets a proxy server.

// We subclass SebSDK to add CURL customization
class MySebSDK extends SebSDK
{
  function setupCurl(&$ch)
  {
    // curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
    curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
    curl_setopt ($ch, CURLOPT_PROXY, 'http://proxy.url');
  }
}

Using the extended SebSDK

You can then use your subclassed SDK as you would a regular SDK class.

  $sdk = new MySebSDK(
    "VENDOR CODE", 
    "SDK SECRET", 
    true);
 
  ...

TroubleShooting

Tunnelling

We have experienced a few simple proxy servers that mangle the request URL when tunneling is turned on.

Please make sure that your proxy server properly handles tunneling.

If the transaction does not work and tunneling is enabled, try turning it off to see if it causes issues.

Error 81

You will receive Error 81 if your proxy server switches its source call between requests within a same session.

This means that your proxy makes it so that Secure-eBook receives the request from one server and the confirmation from a second server.

The Secure-eBook server detects this as a hacking attempt and blocks the transaction.

You should look into your proxy settings to see the possibilities of configuring it to avoid redirecting to other proxies when handling requests that targets the Secure-eBook SDK Server (https://www.secure-ebook.com/sdk.jsp)

There are currently no methods to disable this security feature on our end at the moment.