V
V
Vadim Yagofarov2018-02-25 17:17:55
PHP
Vadim Yagofarov, 2018-02-25 17:17:55

In the wrong encoding, the answer is received from the robokassa?

There is a modified script from robokassa

<?php
$shp_email= strip_tags($email);
$shp_phone = strip_tags($phone);
$shp_shopitem = strip_tags($shopitem); 
$shp_name = strip_tags($name);
echo $email." ".$phone." ".$name." ".$shopitem;

if ($shp_shopitem == 'Модуль - 1 (Начинающий)') {
    $price = 455; 
    }
elseif ($shp_shopitem == 'Модуль - 2 (Любитель)') {
    $price = 642; 
    }
elseif ($shp_shopitem == 'Модуль - 3 (Продвинутый)') {
    $price = 828; 
    }
else {
    $price = 1851; 
    }  
    
    
//echo $price;
// 2.
// Оплата заданной суммы с выбором валюты на сайте ROBOKASSA
// Payment of the set sum with a choice of currency on site ROBOKASSA

// регистрационная информация (логин, пароль #1)
// registration info (login, password #1)
$mrh_login = "";
$mrh_pass1 = "";

// номер заказа
// number of order
$inv_id = time();

// описание заказа
// order description
$inv_desc = "Оплачен $shp_item";

// сумма заказа
// sum of order
$out_summ =  1;

// тип товара
// code of goods
$shp_item = $shp_shopitem;

// предлагаемая валюта платежа
// default payment e-currency
$in_curr = "BANKOCEAN2R";

//email
$email = $shp_email;
// язык
// language
$culture = "ru";
$OutSumCurrency = "RUR";
// формирование подписи
// generate signature

$crc  = md5(""); 
//echo $crc;
// форма оплаты товара
// payment form
print "<html>".
      "<form action='https://merchant.roboxchange.com/Index.aspx' method=POST>".
      "<input type=hidden name=MerchantLogin value=$mrh_login>".
      "<input type=hidden name=OutSum value=$out_summ>".
      "<input type=hidden name=InvId value=$inv_id>".
      "<input type=hidden name=InvDesc value='$inv_desc'>".
      "<input type=hidden name=SignatureValue value=$crc>".
      "<input type=hidden name=shp_item value='$shp_item'>".
      "<input type=hidden name=IncCurrLabel value=$in_curr>".
      "<input type=hidden name=Culture value=$culture>".
      "<input type=hidden name=shp_name value='$shp_name'>".
      "<input type=hidden name=shp_phone value='$shp_phone'>".
       "<input type=hidden name=email value=$email>".
      "<input type=submit value='Оплатить'>".
      "</form></html>";

Here is the data that I transmit and which I plan to use further.
5a92c2ed05e8c981850561.pngThey appear to be transmitted correctly.
The result page is implemented like this


 <br>
 <br>
 <br>






OK

But after payment, the letter somehow ends up in spam, although other letters from this box arrive normally. This time. Two - 2 identical letters come at once, but it is not clear why. But having made a mistake in the variable i.e. instead of I specified shopitem on the result page, then in this case one letter arrives
and the third most important thing is the name of the course that the person buys comes in the wrong encoding, but I think it's the encoding.
5a92c50bead64377466690.png
Tell me where I'm wrong, the 3rd question is especially important

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Artem Spiridonov, 2018-02-25
@customtema

Yes, robokassa on Windows (1251). When I wrote a plugin for it, I did a recoding.
In shp_item can put the primary identifier of the product? And output and send to the mail received from the database by identifier.

A
Alexander, 2018-06-10
@Survtur

There is an Encoding parameter . Set it to 'utf-8'

A
Adamos, 2018-02-25
@Adamos

Robokassa allows you to stick arbitrary fields to the order and returns their value.
What idiot advised you to fill in these purely official fields - in Cyrillic?
So let him train in recoding - he made the rake himself, he stepped on it ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question