codeigniter-phpunit icon indicating copy to clipboard operation
codeigniter-phpunit copied to clipboard

Codeigniter 3 - Class 'MangoPay\MangoPayApi' not found

Open danibe83 opened this issue 7 years ago • 0 comments

Hi all, I'm very new in codeigniter and PHP world, anyway I installed MangoPay sdk by composer, and when I try to connect i received this error:

Message: Class 'MangoPay\MangoPayApi' not found

Library

`<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); require_once './vendor/autoload.php'; class Mangopayservice { private $mangoPayApi; private $user;

public function __construct()
{
    $this->mangoPayApi = new MangoPay\MangoPayApi();
    $this->mangoPayApi->Config->ClientId = '****';
    $this->mangoPayApi->Config->ClientPassword = '*****';
    $this->mangoPayApi->Config->BaseUrl = 'https://api.sandbox.mangopay.com';
    $this->mangoPayApi->Config->TemporaryFolder = '';    
}
public function add_user()
{
    //CREATE NATURAL USER
    $user = new MangoPay\UserNatural();
    $user->Email = '[email protected]';
    $user->FirstName = "John";
    $user->LastName = "Smith";
    $user->Birthday = 121271;
    $user->Nationality = "FR";
    $user->CountryOfResidence = "ZA";

    $add_userResult = $this->mangoPayApi->Users->Create($user);
    var_dump($add_userResult);
}

}` Controller

$this->load->library('mangopayservice'); $this->mangopayservice->add_user(); Can you help me to solve this issue?

Thanks

danibe83 avatar Feb 08 '19 11:02 danibe83