Mangopay / mangopay2-php-sdk

PHP SDK for MANGOPAY
https://packagist.org/packages/mangopay/php-sdk-v2
MIT License
123 stars 134 forks source link

Problem with setup #448

Closed vrax-coder closed 3 years ago

vrax-coder commented 3 years ago

I just download and setup the mangopay2-php-sdk

Here is my linux setup : Apache version 2.2.22 MySQL version 5.5.53 Client MySQL: mysqlnd 5.0.10 PHP Version 5.4.45-0+deb7u6
OpenSSL/1.0.1t => cURL Information : 7.26.0

I use the Installation without Composer

My first PHP line : require_once ($_SERVER["DOCUMENT_ROOT"] . '/php/Mangopay/mangopay2-php-sdk-master/MangoPay/Autoloader.php');

Autoloader work and load all the files

My seconde PHP line : $api = new MangoPay\MangoPayApi(); => Crash of php => the "try { " return nothing

and the test page like : Mangopay/mangopay2-php-sdk-master/tests/cases/ConfigurationTest.php => HTTP ERROR 500

I don't know what to test to move forward. Any idea ?

mangomaxoasis commented 3 years ago

Hi @vrax-coder We're looking into it Max

vrax-coder commented 3 years ago

Thanks.

Le lun. 4 janv. 2021 à 11:34, mangomaxoasis notifications@github.com a écrit :

Hi @vrax-coder https://github.com/vrax-coder We're looking into it Max

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Mangopay/mangopay2-php-sdk/issues/448#issuecomment-753896174, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASJF2LVZGYZDGDR2DLKZANDSYGKR7ANCNFSM4VMJ5CLQ .

SoloJr commented 3 years ago

Hi @vrax-coder

So, I've tried an installation without composer on Windows, and it indeed crashed when using this code:

`<?php require_once './mangopay_php_sdk_v2_3.1.6.0_require/vendor/mangopay/php-sdk-v2/MangoPay/Autoloader.php';

try { $api = new MangoPay\MangoPayApi();

var_dump($api);

} catch (Exception $exception) { var_dump($exception); }`

The problem is that it cannot find the logger, and for that, you should reference the following : require_once 'mangopay_php_sdk_v2_3.1.6.0_require/vendor/psr/log/Psr/Log/LoggerInterface.php'; require_once 'mangopay_php_sdk_v2_3.1.6.0_require/vendor/psr/log/Psr/Log/AbstractLogger.php'; require_once 'mangopay_php_sdk_v2_3.1.6.0_require/vendor/psr/log/Psr/Log/NullLogger.php';

Using this, it will create the object you require. But there can be further issues ahead.

I highly recommend using the sdk with Composer, not without. In this way, you will find it easier to work with MangoPay.

Thanks, Mircea

vrax-coder commented 3 years ago

Thanks ! I install it on my debian 7 PHP 5 apt-get install curl php5-cli git and then curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

here is the problem at the end of the setup : The openssl extension is missing, which means that secure HTTPS transfers are impossible. If possible you should enable it or recompile php with --with-openssl

OpenSSL is installed and work with my certificats for my website. How can I enabled openssl ??? And where ??? in PHP ? I don't find something helpfull on the net.

Have you got an Idea ?

vrax-coder commented 3 years ago

Got it !! I have finaly install composer My problem is that I find Two PHP installed on my debian PHP and PHP5

curl -sS https://getcomposer.org/installer | php5 -- --install-dir=/usr/local/bin --filename=composer

I have installed DRS/log too