Hi.
I have installed "pay" and "market" plugins to elgg 2.35
What I need now is to integrate it to some sort of online shop.
Spent a lot of days but still do not know where to start.
Made a plugin based on blog plugin with technical name 'abb' (in order to distinguish from real plugins).
Added examples from qiwi and yandex payment systems. (commented and some in russian because from russian sources.
This is links to
yandex docs: https://github.com/yandex-money/yandex-money-sdk-php-sample
Qiwi docs: https://developer.qiwi.com/en/qiwipay/index.html?php#authorization
Below will be my code and error...
CODE
<?php
// get the form inputs
$title = get_input('title');
$body = get_input('body');
$tags = string_to_tag_array(get_input('tags'));
$sum = get_input('sum');
$formcomment = get_input('formcomment');
// create a new aab object and put the content in it
$blog = new ElggObject();
$blog->title = $title;
$blog->description = $body;
$blog->tags = $tags;
$blog->sum = $sum;
$blog->formcomment = $formcomment;
// the object can and should have a subtype
$blog->subtype = 'aab';
// for now, make all aab posts public
$blog->access_id = ACCESS_PUBLIC;
// owner is logged in user
$blog->owner_guid = elgg_get_logged_in_user_guid();
// save to database and get id of the new aab
$blog_guid = $blog->save();
//integrating yandex api start
//code taken from https://github.com/yandex-money/yandex-money-sdk-php/
// For payments from the Yandex.Money wallet
require_once '\mod\aab\yandex-money-sdk-php-master\lib\api.php';
// For payments from bank cards without authorization
require_once '\mod\aab\yandex-money-sdk-php-master\lib/external_payment.php';
//Payments from the Yandex.Money wallet
//1.Obtain token URL and redirect user's browser to Yandex.Money service. Note: client_id, redirect_uri,
//client_secret are constants that you get, when register app in Yandex.Money API.
use \YandexMoney\API;
$client_id = $yandex_client_id;
$redirect_uri = yandex_redirect_uri;
$auth_url = API::buildObtainTokenUrl($client_id, $redirect_uri, $scope);
//2.After that, user fills Yandex.Money HTML form and user is redirected back to REDIRECT_URI?code=CODE.
//3.You should immediately exchange CODE with ACCESS_TOKEN.
$access_token_response = API::getAccessToken($client_id, $code, $redirect_uri, $client_secret=$yandex_client_secret);
if(property_exists($access_token_response, "error")) {
// process error
}
$access_token = $access_token_response->access_token;
//4.Now you can use Yandex.Money API.
$api = new API($access_token);
// get account info
$acount_info = $api->accountInfo();
// check status
// get operation history with last 3 records
$operation_history = $api->operationHistory(array("records"=>3));
// check status
// make request payment
$request_payment = $api->requestPayment(array(
"pattern_id" => "p2p",
"to" => $money_wallet,
"amount_due" => $amount_due,
"comment" => $comment,
"message" => $message,
"label" => $label,
));
// check status
// call process payment to finish payment
$process_payment = $api->processPayment(array(
"request_id" => $request_payment->request_id,
));
//Payments from bank cards without authorization
//1.Fetch instantce-id(ussually only once for every client. You can store result in DB).
use \YandexMoney\ExternalPayment;
$response = ExternalPayment::getInstanceId($client_id);
if($response->status == "success") {
$instance_id = $response->instance_id;
}
else {
// throw exception with $response->error message
}
//2.Make request payment
// make instance
$external_payment = ExternalPayment($instance_id);
$payment_options = array(
// pattern_id, etc..
);
$response = $external_payment->request($payment_options);
if($response->status == "success") {
$request_id = $response->request_id;
}
else {
// throw exception with $response->message
}
//3.Process the request with process-payment.
$process_options = array(
"request_id" => $request_id
// other params..
);
$result = $external_payment->process($process_options);
// process $result according to docs
//integrating yandex api END
/*
//QIWI PAYMENT PROCESS BEGINNING EXAMPLE AT https://webcodingsolutions.blogspot.ru/2014/07/qiwi.html
//Сначала нужно выставить пользователю счет. Для этого отправим запрос через cURL:
$url = 'https://w.qiwi.com/api/v2/prv/'.$shopid.'/bills/'.$id;
$loginPass = $apiid.':'.$pass;
$lifetime = date('c', time() + 86400);
$parameters = array(
"user" => "tel:+".intval($mobile),
"amount" => $amount,
"ccy" => $currency,
"comment" => $comment,
"lifetime" => $lifetime,
"pay_source" => "qw"
);
$headers = array(
"Accept: application/json",
"Content-Type: application/x-www-form-urlencoded; charset=utf-8"
);
$parameters = http_build_query($parameters);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $loginPass);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_POST, 1);
$httpResponse = curl_exec($ch);
$results = json_decode($httpResponse);
$result_code = $results->response->result_code;
$description = $results->response->description;
//$shopid - Идентификатор вашего магазина
//$id - ID платежа в вашей системе. Будет использован для поиска нужного платежа в вашей БД
//$apiid - Ваш API ID
//$pass - Пароль API
//$mobile - Телефон (аккаунт) пользователя, на который будет выставлен счет
//$amount - Сумма, на которую выставляется счет
//$currency - Валюта. По-умолчанию доступна только RUB (рубли РФ)
//$comment - Описание платежа
//$lifetime - Время, которое выставленный счет будет активен (можно оплатить). В примере - сутки.
//$result_code - Код ответа сервера. Если не равен 0 - ошибка.
//$description - Текст ошибки, если она есть
//$shopid - Идентификатор вашего магазина (тот-же, что и выше)
//$id - ID платежа в вашей системе. Будет использован для поиска нужного платежа в вашей БД (тот-же, что и выше)
//$success_url - Ссылка на страницу успешной оплаты (Вернуться на ваш сайт после оплаты)
//$fail_url - Ссылка на страницу ошибки или отказа от оплаты (Вернуться на ваш сайт после неудачной оплаты)
//$mobile - Телефон (аккаунт) пользователя, на который будет выставлен счет (тот-же, что и выше)
// И отправляем пользователя на этот URL, например так:
header('Location: '.$url);
//Настройка аккаунта
//Настроить аккаунт можно по адресу: https://ishop.qiwi.com/balance/overview.action (официальный сайт Qiwi)
//Нужно создать проект: "Новый проект". Поля элементарные, описывать не буду. Обратите внимание, что API будут работать только после проверки проекта администрацией Qiwi (статус "Подтвержден").
//Переходим в настройки проекта, кликом на его название:
//Аутентификационные данные для всех протоколов - Сгенерировать новый ID. Записать в свою БД (Идентификатор - переменная $apiid в этой статье, пароль - переменная $pass)
//Идентификатор магазина - Записать в свою БД (переменная $shopid в этой статье)
//Настройки Pull (REST) протокола - Включить
//Включить уведомления - Включить
//URL для оповещения - Ссылка на файл обработки операции. Описание содержания этого файла смотрите в пункте "Обработка запроса" этой статьи
//Сменить пароль оповещения - нажать и сохранить пароль в БД (переменная $key в этой статье)
//Подпись - Отметить галочкой
//Обработка запроса
//После оплаты платежная система присылает запрос на указанный вами URL для оповещения. В этом файле, в первую очередь, необходимо проверить подлинность запроса, ведь он мог быть запущен не платежной системой. После чего уже делаем нужны операции: изменение статуса платежа в вашей БД или пополнение счета пользователя на сайте. Начнем по порядку.
//Система присылает следующие данные (сразу сократим названия переменных, зачем нам в коде длинные переменные?):
$id =trim($_POST['bill_id']);
$status =trim($_POST['status']);
$error =trim($_POST['error']);
$amount =trim($_POST['amount']);
$user =trim($_POST['user']);
$prv_name =trim($_POST['prv_name']);
$ccy =trim($_POST['ccy']);
$comment =trim($_POST['comment']);
$command =trim($_POST['command']);
$head =apache_request_headers();
$hash =$head['X-Api-Signature'];
//bill_id - ID платежа в вашей системе
//status - Статус платежа. Успешный: paid
//error - Ошибка, если она есть
//amount - Сумма платежа
//user - Телефон (аккаунт) пользователя, который оплатил счет
//ccy - Валюта платежа
//comment - Описание платежа
//X-Api-Signature - Подпись запроса (хеш)
//Теперь нужно проверить хеш. Это обязательное действие. Без него безопасность данной операции будет близка к нулю.
//Создадим свой вариант хеша, по возможности используя данные из своей БД (постфикс _bd в переменных; используйте $id для поиска нужной транзакции):
$hash_gen = base64_encode(hash_hmac("sha1", $amount_bd.'|'.$id.'|'.$ccy_bd.'|'.$command.'|'.$comment.'|'.$error.'|'.$prv_name.'|'.$status.'|'.$user_bd, $key, $raw_output=TRUE));
if($hash_gen!=$hash) // ошибка
//Переменная $key - пароль оповещения, который вы встречали в настройках аккаунта
//С проверками закончили. Теперь можно сделать то, ради чего этот запрос пришел - изменить статус транзакции или пополнить счет пользователя, на ваше усмотрение. И эти действия я описывать не буду - все в ваших руках.
//Осталось только вернуть системе правильный ответ.
//Ответ для успешного завершения:
header("HTTP/1.1 200 OK");
header('content-type: text/xml; charset=UTF-8');
echo '0';
exit;
//Для завершения с ошибкой - измените result_code (0) на другой:
//5 - Ошибка формата параметров запроса
//13 - Ошибка соединения с базой данных
//150 - Ошибка проверки пароля
//151 - Ошибка проверки подписи
//300 - Ошибка связи с сервером
QIWI PAYMENT PROCESS ENDING EXAMPLE AT https://webcodingsolutions.blogspot.ru/2014/07/qiwi.html
*/
// if the aab was saved, we want to display the new post
// otherwise, we want to register an error and forward back to the form
if ($blog_guid) {
system_message("Your blog post was saved.");
forward($blog->getURL());
} else {
register_error("The blog post could not be saved.");
forward(REFERER); // REFERER is a global variable that defines the previous page
}
ERROR
obtain access_token first
Log at time 1523977608 may have more data.
Exception Object
(
[message:protected] => obtain access_token first
[string:Exception:private] => Exception: obtain access_token first in C:\MAMP\htdocs\elgg-2.0.3\mod\aab\yandex-money-sdk-php-master\lib\api.php:20
Stack trace:
#0 C:\MAMP\htdocs\elgg-2.0.3\mod\aab\yandex-money-sdk-php-master\lib\api.php(15): YandexMoney\API->checkToken()
#1 C:\MAMP\htdocs\elgg-2.0.3\mod\aab\yandex-money-sdk-php-master\lib\api.php(38): YandexMoney\API->sendAuthenticatedRequest('/api/account-in...')
#2 C:\MAMP\htdocs\elgg-2.0.3\mod\aab\actions\aab\save.php(69): YandexMoney\API->accountInfo()
#3 C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\Includer.php(18): include('C:\\MAMP\\htdocs\\...')
#4 C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\ActionsService.php(176): Elgg\Includer::includeFile('C:\\MAMP\\htdocs\\...')
#5 C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\lib\actions.php(22): Elgg\ActionsService->execute('aab/save')
#6 [internal function]: _elgg_action_handler(Array, 'action')
#7 C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\Router.php(100): call_user_func('_elgg_action_ha...', Array, 'action')
#8 C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\Application.php(436): Elgg\Router->route(Object(Elgg\Http\Request))
#9 C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\Application.php(384): Elgg\Application->run()
#10 C:\MAMP\htdocs\elgg-2.0.3\index.php(8): Elgg\Application::index()
#11 {main}
[code:protected] => 0
[file:protected] => C:\MAMP\htdocs\elgg-2.0.3\mod\aab\yandex-money-sdk-php-master\lib\api.php
[line:protected] => 20
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\mod\aab\yandex-money-sdk-php-master\lib\api.php
[line] => 15
[function] => checkToken
[class] => YandexMoney\API
[type] => ->
[args] => Array
(
)
)
[1] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\mod\aab\yandex-money-sdk-php-master\lib\api.php
[line] => 38
[function] => sendAuthenticatedRequest
[class] => YandexMoney\API
[type] => ->
[args] => Array
(
[0] => /api/account-info
)
)
[2] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\mod\aab\actions\aab\save.php
[line] => 69
[function] => accountInfo
[class] => YandexMoney\API
[type] => ->
[args] => Array
(
)
)
[3] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\Includer.php
[line] => 18
[args] => Array
(
[0] => C:\MAMP\htdocs\elgg-2.0.3\mod\aab\actions\aab\save.php
)
[function] => include
)
[4] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\ActionsService.php
[line] => 176
[function] => includeFile
[class] => Elgg\Includer
[type] => ::
[args] => Array
(
[0] => C:\MAMP\htdocs\elgg-2.0.3\mod\aab/actions/aab/save.php
)
)
[5] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\lib\actions.php
[line] => 22
[function] => execute
[class] => Elgg\ActionsService
[type] => ->
[args] => Array
(
[0] => aab/save
)
)
[6] => Array
(
[function] => _elgg_action_handler
[args] => Array
(
[0] => Array
(
[0] => aab
[1] => save
)
[1] => action
)
)
[7] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\Router.php
[line] => 100
[function] => call_user_func
[args] => Array
(
[0] => _elgg_action_handler
[1] => Array
(
[0] => aab
[1] => save
)
[2] => action
)
)
[8] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\Application.php
[line] => 436
[function] => route
[class] => Elgg\Router
[type] => ->
[args] => Array
(
[0] => Elgg\Http\Request Object
(
[attributes] => Symfony\Component\HttpFoundation\ParameterBag Object
(
[parameters:protected] => Array
(
)
)
[request] => Symfony\Component\HttpFoundation\ParameterBag Object
(
[parameters:protected] => Array
(
[__elgg_token] => L1Y38Eo-XvchQgBIaQ9ZYQ
[__elgg_ts] => 1523977533
[title] => оплата 0,01 рубля или 0,25 как в коде проверка
[body] => тест 170418
[tags] =>
[sum] => 0.01
[formcomment] => Горщочек Вари 1
)
)
[query] => Symfony\Component\HttpFoundation\ParameterBag Object
(
[parameters:protected] => Array
(
[__elgg_uri] => /action/aab/save
)
)
[server] => Symfony\Component\HttpFoundation\ServerBag Object
(
[parameters:protected] => Array
(
[REDIRECT_UNIQUE_ID] => WtYNhQoAAg8AAAdckwgAAAA7
[REDIRECT_no-gzip] => 1
[REDIRECT_dont-vary] => 1
[REDIRECT_STATUS] => 200
[UNIQUE_ID] => WtYNhQoAAg8AAAdckwgAAAA7
[HTTP_HOST] => localhost
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[HTTP_ACCEPT_LANGUAGE] => ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[HTTP_REFERER] => http://localhost/elgg-2.0.3/aab/add/36
[HTTP_COOKIE] => Elgg=ar1pakog88f7d6964cebiai9m6; SQLiteManager_currentLangue=2; Elgg_install=1uqp6c4mctiafcmjilkrdtav51
[HTTP_CONNECTION] => keep-alive
[CONTENT_TYPE] => application/x-www-form-urlencoded
[CONTENT_LENGTH] => 403
[PATH] => C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\
[SystemRoot] => C:\Windows
[COMSPEC] => C:\Windows\system32\cmd.exe
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
[WINDIR] => C:\Windows
[SERVER_SIGNATURE] =>
[SERVER_SOFTWARE] => Apache/2.2.27 (Win32) DAV/2 mod_ssl/2.2.27 OpenSSL/1.0.2e mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.6 PHP/7.0.0 mod_perl/2.0.8 Perl/v5.16.3
[SERVER_NAME] => localhost
[SERVER_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[REMOTE_ADDR] => 127.0.0.1
[DOCUMENT_ROOT] => C:/MAMP/htdocs
[SERVER_ADMIN] => testemail@test.com
[SCRIPT_FILENAME] => C:/MAMP/htdocs/elgg-2.0.3/index.php
[REMOTE_PORT] => 49247
[REDIRECT_QUERY_STRING] => __elgg_uri=action/aab/save
[REDIRECT_URL] => /elgg-2.0.3/action/aab/save
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => POST
[QUERY_STRING] => __elgg_uri=action/aab/save
[REQUEST_URI] => /elgg-2.0.3/action/aab/save
[SCRIPT_NAME] => /elgg-2.0.3/index.php
[PHP_SELF] => /elgg-2.0.3/index.php
[REQUEST_TIME_FLOAT] => 1523977605.471
[REQUEST_TIME] => 1523977605
)
)
[files] => Symfony\Component\HttpFoundation\FileBag Object
(
[parameters:protected] => Array
(
)
)
[cookies] => Symfony\Component\HttpFoundation\ParameterBag Object
(
[parameters:protected] => Array
(
[Elgg] => ar1pakog88f7d6964cebiai9m6
[SQLiteManager_currentLangue] => 2
[Elgg_install] => 1uqp6c4mctiafcmjilkrdtav51
)
)
[headers] => Symfony\Component\HttpFoundation\HeaderBag Object
(
[headers:protected] => Array
(
[host] => Array
(
[0] => localhost
)
[user-agent] => Array
(
[0] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
)
[accept] => Array
(
[0] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
)
[accept-language] => Array
(
[0] => ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
)
[accept-encoding] => Array
(
[0] => gzip, deflate
)
[referer] => Array
(
[0] => http://localhost/elgg-2.0.3/aab/add/36
)
[cookie] => Array
(
[0] => Elgg=ar1pakog88f7d6964cebiai9m6; SQLiteManager_currentLangue=2; Elgg_install=1uqp6c4mctiafcmjilkrdtav51
)
[connection] => Array
(
[0] => keep-alive
)
[content-type] => Array
(
[0] => application/x-www-form-urlencoded
)
[content-length] => Array
(
[0] => 403
)
)
[cacheControl:protected] => Array
(
)
)
[content:protected] =>
[languages:protected] =>
[charsets:protected] =>
[encodings:protected] =>
[acceptableContentTypes:protected] =>
[pathInfo:protected] =>
[requestUri:protected] => /elgg-2.0.3/action/aab/save
[baseUrl:protected] =>
[basePath:protected] =>
[method:protected] =>
[format:protected] =>
[session:protected] =>
[locale:protected] =>
[defaultLocale:protected] => en
[isForwardedValid:Symfony\Component\HttpFoundation\Request:private] => 1
)
)
)
[9] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\vendor\elgg\elgg\engine\classes\Elgg\Application.php
[line] => 384
[function] => run
[class] => Elgg\Application
[type] => ->
[args] => Array
(
)
)
[10] => Array
(
[file] => C:\MAMP\htdocs\elgg-2.0.3\index.php
[line] => 8
[function] => index
[class] => Elgg\Application
[type] => ::
[args] => Array
(
)
)
)
[previous:Exception:private] =>
)
So Where should I dig?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 1 like
- Vitaly Kononenko@vitalykononenko
Vitaly Kononenko - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Vitaly Kononenko@vitalykononenko
Vitaly Kononenko - 0 likes
Requires
PHP extension: intl
Error
- iionly@iionly
iionly - 1 like
- Vitaly Kononenko@vitalykononenko
Vitaly Kononenko - 0 likes
You must log in to post replies.Very hard to understand what you'll try to do w/o source code. GitHub/Gist will be useful for it.
Also, I'm assume that you're using the outdated Elgg pay plugin. (?)
There are some newset plugins which could help you (all thanks goes to Ismayil Khayredinov).
For example, we've maked eStore using PayPal API + Elgg payments + Payment PayPal API + Market + own customizations.
So, try the newest plugins (and Elgg), use GitHub/Gist for uploading your code and back again to Community ;)
PS: Присоединяйся к нашему каналу в телеге - @elggnews - где мы постим своевременные и актуальные ссылки/новости на Elgg проекты.
Hello.
...
<For example, we've maked eStore using PayPal API + Elgg payments + Payment PayPal API + Market + <own customizations.
...
They do not work due missing dependencies and Paypal SDK what is it? Is it plugin? Which folder had I to had saved in? (Market works)
I have uploaded plugin to github here
Click on plugin name (on the 'Plugins' page) and you will see pop up window with tab 'Dependencies'.
Learn it and read it also.
Need for Paypal payments like as Yandex SDK for ЯндексДеньги. In the Payment PayPal API already.
In the /mod dir
OK. Do you have any PHP experience?
Because your code says "no"...
What is it talking about. I have latest version of MAMP 3.2.0 PHP version 7.0
My code never lies.
As the dependency requirement says: the php extension "intl" is needed. You would have to install this extension (no idea if MAMP includes it already or how to add if not) or enable/load it in the Apache configuration respectively. For php 7 the package is most likely named php7-intl.
Activated.
Had to uncomment (delete ; sign) from extension=php_intl.dll in C:\MAMP\conf\php7.1.7\php.ini)
Then had to copy all ****56.dll files from C:\MAMP\bin\php\php7.1.7 to C:\MAMP\bin\apache\bin
And restart mamp.
So stupid it did not work out of the box.