Direct to Card - Cellfire PHP SOAP API interaction example

Hi, one of our clients decided to implement Cellfire Direct to Card coupons. To start using this api you need to get wsdl file url and two http headers values Api-Key and tlc.

After you get these parameters please use code below to connect to Cellfire SOAP API. I spent some time to realize how to do it. I hope it will save your time.

Thank you

//Please wrote code!
$params = array (
    'trace' => 1,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'stream_context' =>
          'http' => array(
            'header' =>
// Please note! There is a space between secrets values and :
              'Api-Key: your_secret_key' . PHP_EOL .
              'tlc: your_secret_tlc' . PHP_EOL,

  $client = new SoapClient('http://path_to_external_wsdl_file', $params);

// You can also review raw HTTP request and response.
// To make it use following functions.

// To get full list of SOAP server supported function use.