• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MicroSMS transfer payment

MalyFanek

New Member
Joined
Oct 10, 2019
Messages
37
Reaction score
2
Hello, I have a problem and basically a question. Well, I'm trying to add payments from microsms and here comes the case, files should be pasted only in payments, add in config and to the folder gesior shop?Or also somewhere else?I got a sms payment from them, I just created a script from them in the admin panel as a new page, I added a link to the shop with a redirection icon and all works fine but while i try to add bank transfer its shows empty page or some hieroglyphics and I'm already green and I'm playing with it probably week xD shop like active etc.

Of course, the script also has "ready" downloaded from:

https://microsms.pl/documents/skrypt.zip

And now i have no idea, shall I add for each bank transfer add new script? (i think its not)

Those are the scripts:
Code:
<?php

    /*
        Konfiguracja przelewów
    */
        $config = array(
            'transfers' => array(

                /*
                    shopid - parametr umożliwiający idetyfikacje sklepu przyjmującego płatność.
                */
                'shopid' => 51,

                /*
                    ID partnera w serwisie
                */

                'userid' => 1,

                /*
                    HASh, który uniemożliwi osobą nieautoryzowanym "podrobienie" płatności
                    i odebranie płatności bez ponoszenia kosztów.

                    HASH można wygenerować przechodząc w poniższe zakładki
                    Panel bilingowy -> Przelewy online -> Sklepy -> wybieramy nasz sklep i go edytujemy -> znajduje się tutaj
                    pole Hash, który należy skopiować i wkleić poniżej.

                    Pamiętaj, aby nikomu go nie udostępniać.
                    Możesz w ten sposób narazić się na ogromne straty finansowe!
                */
                'hash' => '3137134542',

                /*
                    Tytuł płatności
                */
                'description' => 'Przykładowy tytuł',
               
                /*
                    Adres url pod który system MicroSMS
                    ma przesłać informacje do księgowości
                */
                'return_urlc' => 'https://microsms.pl/przelewy?checkPayment',
               
                /*
                    Adres pod który zostanie odesłany klient po dokonaniu płatności
                */
                'return_url' => 'https://microsms.pl/przelewy/',
            )
        );

    /*
        Inicjujemy klasę mPaySafeCard
    */
        include('microsms.class.php');  
        $transfer = new MicroSMSTransfers;


    /*
        Odbiór i księgowanie płatności
    */

     if(isset($_GET['checkPayment']) && $_POST['status']) {

        /*
            Wyłączamy szablon
        */
            ob_clean();

        /*
            Dostęp do tej zakładki może mieć tylko i wyłącznie MicroSMS!
            Nie należy usuwać oraz modyfikować tej funkcji.
        */
            $psc->validate_ipn();

        /*
            Należy zabezpieczyć się przed nieautoryzowanymi płatnościami.
            Koniecznie sprawdzaj jaki userid otrzymał tą płatność!
        */
            $psc->validate_user($config, $_POST);

        /*
            MicroSMS prześle metodą post pod zdefiniowany link url w formularu
            pakiet pakietów.
           
            status      => Status płatności TRUE i FALSE
            test        => Informacja czy transakcja jest testowa czy produkcyjna TRUE i FALSE
            email       => Adres Email płacącego
            orderID     => Unikalny numer transakcji
            control     => Pole dla sklepu, umożliwiające m.in zapisanie sesji
            amountIni   => Wartość zainicjowanej kwoty
            amountPay   => Wartość wpłaconej kwoty w banku
            description => Opis płatności zdefiniowany w fomrmularzu
            control
        */

        /*
            Przykład zastosowania
        */
            if($_POST['status'] == TRUE) {
                // dalsza część kodu
                // np. zapytanie mysql
                // SELECT * FROM `payments` WHERE `control` = $_POST['control']
            }

        /*
            Zamykamy skrypt odpowiedzią dla MicroSMS
        */
            exit('OK');
     }

     /*
        Poniżej możesz skonfigurować odpowiedzi w przypadku
        negatywnych lub pozytywnych płatności
    */

        if(isset($_GET['status']) && isset($_GET['hash']) && isset($_GET['orderID'])) {

            if($_GET['hash'] == md5($_GET['status'].$_GET['orderID'].$config['transfers']['hash'])) {
               if($_GET['status'] == true) {
                    $okmsg = 'Płatność przebiegła prawidłowo';
                } else {
                    $errormsg = 'Płatność przebiegła negatywnie.';
                }
            } else {
                $errormsg = 'Płatność przebiegła negatywnie.';
            }
        }

    /*
        Generujemy formularz płatności
    */
        if(isset($_POST['send'])) {

            if(!isset($_POST['email']) OR !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))
                $errormsg = 'Adres email jest nieprawidłowy.';

            if(isset($_POST['amount'])) {
                if (!is_numeric($_POST['amount']) == TRUE OR $_POST['amount'] < 1) {
                   // $errormsg = 'Minimalna kwota transakcji to 1 PLN';
                }
            } else {
            //    $errormsg = 'Minimalna kwota transakcji to 1 PLN';
            }

         
            if(!isset($errormsg)) {

                /*
                    Poniższe funkcje wygenerują formularz
                    oraz przeniosą do płatności
                */
                $transfer->add('shopid', $config['transfers']['shopid']);
                $transfer->add('return_url', $config['transfers']['return_url']);
                $transfer->add('return_urlc', $config['transfers']['return_urlc']);
                $transfer->add('description', $config['transfers']['description']);
                $transfer->add('amount', $_POST['amount']);
                $transfer->add('signature', md5($config['transfers']['shopid'] . $config['transfers']['hash'] . $_POST['amount']));
                $transfer->add('email', $_POST['email']);
                $transfer->add('control', '1234');
                $transfer->submit();

                /*
                    Jeśłi wystąpił by błąd z generowaniem płatności
                    klient zobaczy poniższy komunikat
                */
                $errormsg = 'Płatność nie mogła zostać wygenerowana.';
            }
        }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
   <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      <title>Przykladowy skrypt platnosci online</title>
      <style>
        body {
            font-size: 11px;
            font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif;
            font-weight: normal;
        }
        #page {
            width: 600px;
            padding: 20px;
            margin-left: auto;
            margin-right: auto;
            border: 1px solid #c6c6c6;
        }
        .center {
            text-align: center;
        }
        .alert-box {
            color: #555;
            border-radius: 10px;
            font-family: Tahoma, Geneva, Arial, sans-serif;
            font-size: 11px;
            padding: 10px 10px 10px 36px;
            margin: 10px;
        }
        .alert-box span {
            font-weight: bold;
            text-transform: uppercase;
        }
        .notice {
            background: #e3f7fc;
            border: 1px solid #8ed9f6;
        }
        .title {
            font-size: 20px;
            font-weight: bold;
        }
        input[type=text],
        textarea {
            -webkit-transition: all 0.30s ease-in-out;
            -moz-transition: all 0.30s ease-in-out;
            -ms-transition: all 0.30s ease-in-out;
            -o-transition: all 0.30s ease-in-out;
            outline: none;
            padding: 3px 0px 3px 3px;
            margin: 5px 1px 3px 0px;
            border: 1px solid #DDDDDD;
        }
        .button {
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #d0451b), color-stop(1, #bc3315));
            background: -moz-linear-gradient(top, #d0451b 5%, #bc3315 100%);
            background: -webkit-linear-gradient(top, #d0451b 5%, #bc3315 100%);
            background: -o-linear-gradient(top, #d0451b 5%, #bc3315 100%);
            background: -ms-linear-gradient(top, #d0451b 5%, #bc3315 100%);
            background: linear-gradient(to bottom, #d0451b 5%, #bc3315 100%);
            filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#d0451b', endColorstr='#bc3315', GradientType=0);
            background-color: #d0451b;
            display: inline-block;
            cursor: pointer;
            color: #ffffff;
            font-family: arial;
            font-size: 13px;
            padding: 6px 12px;
            text-decoration: none;
            border: 0px;
        }
        .button:hover {
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #bc3315), color-stop(1, #d0451b));
            background: -moz-linear-gradient(top, #bc3315 5%, #d0451b 100%);
            background: -webkit-linear-gradient(top, #bc3315 5%, #d0451b 100%);
            background: -o-linear-gradient(top, #bc3315 5%, #d0451b 100%);
            background: -ms-linear-gradient(top, #bc3315 5%, #d0451b 100%);
            background: linear-gradient(to bottom, #bc3315 5%, #d0451b 100%);
            filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#bc3315', endColorstr='#d0451b', GradientType=0);
            background-color: #bc3315;
        }
        .button:active {
            position: relative;
            top: 1px;
        }
        table {
            border-collapse: collapse;
            width: 100%;
        }
        td {
            border: 2px solid #000000;
            padding: 5px;
        }
        .header {
            font-weight: bold;
        }
        table#table {
            border-collapse: collapse;
            width: 100%;
        }
        #table td {
            border-width: 1px;
            border-style: solid;
            border-color: #dddddd;
            padding: 5px;
        }
        #table .header {
            font-weight: bold;
        }
        #table .emp {}

        .msg {
            margin: 0 10px 20px 10px;
            font-family: Tahoma;
            font-weight: bold;
            line-height: 16px;
            font-size: 14px;
            padding: 10px 20px;
            -moz-border-radius: 6px;
            -khtml-border-radius: 6px;
            -webkit-border-radius: 6px;
            border-radius: 6px;
        }
        .msg a {
            color: #555;
            font-family: Tahoma;
            text-decoration: underline;
        }
        .msg.ok {
            background: #e0f2cb;
            border: 1px solid #ccebac;
            color: #6da827;
        }
        .msg.error {
            background: #fbd3b1;
            border: 1px solid #f5c69a;
            color: #e54800;
        }
        .msg.alert {
            background: #fbe47a;
            border: 1px solid #f5c69a;
        }
        .msg.alert a {
            color: #666;
            text-decoration: none;
            font-weight: bold;
        }
        .msg.notice {
            background: #DDDDDD;
            border: 1px solid #999;
        }
        .msg.notice a {
            color: #666;
            text-decoration: none;
            font-weight: bold;
        }
        .msg2 {
            color: #fff;
            text-shadow: #414141 0px 0px 4px;
            margin-bottom: 4px;
            font-family: Tahoma;
            font-weight: bold;
            line-height: 16px;
            font-size: 14px;
            padding: 10px 0 10px 20px;
            -moz-border-radius: 6px;
            -khtml-border-radius: 6px;
            -webkit-border-radius: 6px;
            border-radius: 6px;
        }
        .msg2 a {
            color: #6da827;
            font-family: Tahoma;
            font-weight: normal;
            text-decoration: underline;
        }
        .msg2.warn {
            background: #f8a95b;
            border: 1px solid #fe952e;
        }
        .msg2.warn a {
            color: #666;
            text-decoration: none;
            font-weight: bold;
        }
        </style>
   </head>
   <body>
     <div id="page">
         <div class="center title">Zakup produktu - TEST v2</div>
         <br/>
         <div class="center">
            <p>
                Jest to przykładowy skrypt realizowania płatności online za pośrednictwem MicroSMS.
            </p>

            <?php if(isset($okmsg)) { ?><div class="msg ok"><?php echo $okmsg; ?></div><?php } ?>
            <?php if(isset($errormsg)) { ?><div class="msg error"><?php echo $errormsg; ?></div><?php } ?>
           
            <form method="post" >
               <input type="hidden" name="send" value="" />  
               <input name="email" placeholder="E-Mail" type="text" />
               <input name="amount" placeholder="Kwota transakcji" type="text" /><br/>
               <button class="button" type="submit">Przejdź do płatności</button>
            </form>
   
         </div>
      </div>
   </body>
</html>

And the other one:
Code:
<?php

    class MicroSMSTransfers
    {
        private $url = 'https://microsms.pl/api/bankTransfer/';
        private $ips = 'https://microsms.pl/psc/ips/';
        private $fields = array();
     
        function add($field, $value)
        {
            $this->fields[$field] = $value;
        }
     
        function submit()
        {
            echo '<html xmlns="http://www.w3.org/1999/xhtml">
                    <head>
                        <title>Przekierowanie do platnosci ...</title>
                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                        <script>
                            function submitform() {
                                document.getElementById(\'send\').submit();
                            }
                        </script>
                    </head>
                            <body onload="submitform();">
                    <h3>Przekierowanie do platnosci ...</h3>
                    <form id=\'send\' action="' . $this->url . '" method="get"  >
                    ';
         
            foreach ($this->fields as $name => $value) {
                echo "<input type=\"hidden\" name=\"$name\" value=\"$value\">";
            }
         
            echo '<input type="hidden" name="charset" value="utf-8" />
                        <input type="submit" value="Kliknij tutaj, jezeli nie zostaniesz przeniesiony w ciągu 10 sekund" />
                    </form>
                    </body>
                    </html>';
            exit();
        }
     
        public function validate_ipn()
        {
            if (!in_array($_SERVER['REMOTE_ADDR'], explode(',', file_get_contents($this->ips))) == TRUE) {
                exit('Access denid.');
            }
        }

        public function validate_user($config, $post)
        {
            if ($config['transfers']['userid'] != $post['userid'])
                exit('Bad user');
           
        }
    }

and maybe this will help too:
Docs

tfs 3777, client 8,6, AAC lastest Slawkens version, dunno is it needed more info
 
Back
Top