четверг, 22 марта 2018 г.

application=be-interactive
secret=6457645hvRTG543tryhr

message_template

Array
(
    [application] => be-interactive
    [email] => a.rukovitcin@be-interactive.ru
    [name] => schablon
    [tmpl] => helloworld
    [vk_group_url] => https://vk.com/public163968822
)
bin2hex(6457645hvRTG543tryhr)=3634353736343568765254473534337472796872 //проверьте так ли отрабатывает ваша функция hex_lowercase_without_0x()
text=message_templateapplicationbe-interactiveemaila.rukovitcin@be-interactive.runameschablontmplhelloworldvk_group_urlhttps://vk.com/public1639688223634353736343568765254473534337472796872
signature=md5(urlencode(text))=8986eb7cba9f4c4382dc2b5c47e11726


https://apinotify.mail.ru/message_template?application=be-interactive&email=a.rukovitcin%40be-interactive.ru&name=schablon&tmpl=helloworld&vk_group_url=https%3A%2F%2Fvk.com%2Fpublic163968822&signature=8986eb7cba9f4c4382dc2b5c47e11726
{"status":"OK"}

notify

Array
(
    [application] => be-interactive
    [phone] => +79199610491
    [routes] => vk
    [service] => be-interactive_schablon
    [session_id] => 48b1cdcd7klf0kit7dshcompv5
    [status_url] => http://ya.ru
    [text] => putin
    [tmpl] => helloworld
)
text=notifyapplicationbe-interactivephone+79199610491routesvkservicebe-interactive_schablonsession_id48b1cdcd7klf0kit7dshcompv5status_urlhttp://ya.rutextputintmplhelloworld3634353736343568765254473534337472796872
signature=md5(urlencode(text))=d39af003222eded0fbbf69fbca651b16


https://apinotify.mail.ru/notify?application=be-interactive&phone=%2B79199610491&routes=vk&service=be-interactive_schablon&session_id=48b1cdcd7klf0kit7dshcompv5&status_url=http%3A%2F%2Fya.ru&text=putin&tmpl=helloworld&signature=d39af003222eded0fbbf69fbca651b16
{"status":"ERROR","detail_status":"UNDEFINED_SERVICE"}





   <?php    session_start();
    $application='be-interactive';    $secret='6457645hvRTG543tryhr';
    echo 'application='.$application.'<br>secret='.$secret;
function p($S){    echo "<pre>";    print_r($S);    echo "</pre>";}
    echo'<h1>message_template</h1>';
    $param['tmpl']='helloworld';    ////$param['tmpl']='Уважаемый #username# вам скидка #percent#% на покупку #goods#';    $param['application']=$application;    $param['email']='a.rukovitcin@be-interactive.ru';    $param['vk_group_url']='https://vk.com/club76579123';    $param['name']='schablon77';    ksort($param);    p($param);
    foreach($param as $k=>$v)    {        $ff.=''.$k.''.$v;        $fff.=$k.'='.urlencode($v).'&';    }    $ff=trim($ff);    $fff=trim($fff);
    $hex=bin2hex($secret);    echo 'bin2hex('.$secret.')='.$hex.' //проверьте так ли отрабатывает ваша функция hex_lowercase_without_0x()<br>';
    $tt="message_template".$ff."".$hex;//message_template+application+be-interactive+email+a.rukovitcin@be-interactive.ru+name+schablon+tmpl+privetmedved+vk_group_url+vk+3634353736343568765254473534337472796872
    $signature=md5(urlencode($tt));    $ttt="https://apinotify.mail.ru/message_template?".$fff."signature=".$signature;//https://apinotify.mail.ru/message_template?application=be-interactive&email=a.rukovitcin@be-interactive.ru&name=schablon&tmpl=privetmedved&vk_group_url=vk&signature=61c9cd2a3ec916d45f3db35968e5c52f
    echo "text=".$tt;    echo "<br>signature=md5(urlencode(text))=".$signature;
    echo "<p><p><p><a href='".$ttt."'>".$ttt."</a><br>".file_get_contents($ttt);
    //{"status":"ERROR","detail_status":"INCORRECT_SIGNATURE"}
    echo'<h1>notify</h1>';
    //$url='https://apinotify.mail.ru/notify?    $param2['service']=$application.'_'.$param['name'];    //$param2['service']=$param['name'];    $param2['phone']='+79199610491';    $param2['text']='putin';    $param2['session_id']=session_id();    $param2['routes']='vk';    $param2['application']=$param['application'];    $param2['status_url']='http://ya.ru';    $param2['tmpl']=$param['tmpl'];
    ksort($param2);    p($param2);
    unset($ff);    unset($fff);    foreach($param2 as $k=>$v)    {        $ff.=''.$k.''.$v;        $fff.=$k.'='.urlencode($v).'&';    }    $ff=trim($ff);    $fff=trim($fff);
    $tt="notify".$ff."".$hex;    $signature=md5(urlencode($tt));    $ttt="https://apinotify.mail.ru/notify?".$fff."signature=".$signature;    echo "text=".$tt;    echo "<br>signature=md5(urlencode(text))=".$signature;
    echo "<p><p><p><a href='".$ttt."'>".$ttt."</a><br>".file_get_contents($ttt);
    ?>

Комментариев нет:

Отправить комментарий