1
I am implementing the communication with Cielo servers for a system of my.
However, when I try to load the Cielo library, I get an error. The folder structure is as follows:
- third_party / Cielo / {lib files straight from Cielo git}
- controllers / Cielo_homol.php { my test controller }
On the 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 begins my problems, Is returning me the following error:
An uncaught Exception was encountered
Type: Error
Message: Class 'Cielo Merchant' not found
Filename: /Users/raphaelschubert/projects/clients/miPague/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/clients/miPague/index.php Line: 292 Function: require_once
Cielo.php I didn’t move, it’s original same as the library provided in the Cielo git link. LINK TO GITHUB ARCHIVE HERE
Would anyone have a light to give me? Grateful for the help...
Thank you! Now the library is loading... But now returned the following error:
Class 'Cielo\Cielo' not found
– Raphael Schubert
from what I understand, on the line where there is: code
$cielo = new Cielo(...); ele não conseguiu fazer o Load da class
– Raphael Schubert
COMPLETE ERROR:
An uncaught Exception was encountered

Type: Error

Message: Class 'Cielo\Cielo' not found

Filename: /Users/raphaelschubert/projetos/clientes/miPague/application/controllers/Cielo_Homol.php

Line Number: 16
– Raphael Schubert