I'm implementing communication with Cielo servers for a system of mine.
However, trying to load the Cielo library gives me an error. The folder structure is as follows:
- third_party / Cielo / {sky git direct lib files}
- controllers / Cielo_Homol.php {my test driver}
In controller Cielo_Homol.php
I have the following code:
<?php defined('BASEPATH') OR exit('No direct script access allowed');
require APPPATH.'third_party/Cielo/Cielo.php';
require APPPATH.'third_party/Cielo/CieloException.php';
require APPPATH.'third_party/Cielo/Transaction.php';
require APPPATH.'third_party/Cielo/Holder.php';
require APPPATH.'third_party/Cielo/PaymentMethod.php';
use Cielo\Cielo;
use Cielo\CieloException;
use Cielo\Transaction;
use Cielo\Holder;
use Cielo\PaymentMethod;
class Cielo_Homol extends CI_Controller {
private $mid = '1006993069';
private $key = '25fbb99741c739dd84d7b06ec78c9bac718838630f30b112d033ce2e621b34f3';
public function index(){
$cielo = new Cielo($this->mid, $this->key, Cielo::TEST);
}
}
I'm just trying to run the object to generate errors and start filling in the request data ... BUT, and now starts my problems, you're returning the following error:
An uncaught Exception was encountered
Type: Error
Message: Class 'Sky \ Merchant' not found
Filename: /Users/raphaelschubert/projects/clients/myPage/application/third_party/Cielo/Cielo.php
Line Number: 59
Backtrace:
File: /Users/raphaelschubert/projects/clients/miPague/application/controllers/Cielo_Homol.php Line: 23 Function: __construct
File: /Users/raphaelschubert/projects/clientes/miPague/index.php Line: 292 Function: require_once
Cielo.php I did not move, it's original just like the library provided in the git link from Cielo.
Would anyone have a light to give me? Thanks for the help ...