E
E
Eugene2017-02-16 15:10:56
PHP
Eugene, 2017-02-16 15:10:56

Payment in robocas commission at the expense of the store who knows how to set it up?

Payment in robocas commission at the expense of the store who knows how to set it up? according to their documentation it is difficult to understand, maybe someone knows? there is an example or will help to figure it out, I will be grateful
The payment is already set up, it remains only to make sure that the commission is paid by the store and not by the buyer

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
display: block, 2017-02-16
@qork

support.robokassa.ru/ViewFaq.aspx?FaqID=92

E
Eugene, 2017-02-16
@lansas

Good afternoon! here's how to edit here so that the store pays the commission

<?
$mrh_login = "********";
$mrh_pass1 = "********";

//2 *******


// номер заказа
$inv_id = rand();

// описание заказа
$inv_desc = $_GET[desc];

// сумма заказа
$out_summ = $_GET[sum];

// артикул товара товара
$name = "Имя: $_POST[name],";
$email = "Email: $_POST[email],";
$phone = "Телефон: $_POST[phone],";
$shp_item = $_POST[shp_item];
$encoding = "utf-8";

// язык
$culture = "ru";

// формирование подписи
$crc  = md5("$mrh_login:$out_summ:$inv_id:$mrh_pass1:Shp_item=$shp_item");

  $to = "********"; /*Укажите адрес, га который должно приходить письмо*/
    $headers .= 'From: *****' . "\r\n"; 
  $subject = "*****";
    $message = "Услуга: $inv_desc
  Сумма: $out_summ
  Номер заказа: $inv_id
  $name
  $email
  $phone";
  
  
  
    $send = mail ($to, $subject, $message, $headers);

// форма оплаты товара
///https://auth.robokassa.ru/Merchant/Index.aspx
print "<html>".
    "<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js'></script>".
      "<form id='target' action='https://merchant.roboxchange.com/Index.aspx' method=POST>".
      "<input type=hidden name=MrchLogin value=$mrh_login>".
      "<input type=hidden name=OutSum value=$out_summ>".
      "<input type=hidden name=InvId value=$inv_id>".
      "<input type=hidden name=Desc value='$inv_desc'>".
      "<input type=hidden name=SignatureValue value=$crc>".
      "<input type=hidden name=Culture value=$culture>".
    "<input type=hidden name=Encoding value=$encoding>".
    "<input type=hidden name=Shp_item value='$shp_item'>".
      "<input type=submit class='submit' value='Pay'>".
      "</form><script src='/js/pay.js'></script></html>";
?>

T
trevoga_su, 2017-02-16
@trevoga_su

<?php
// цена продукта
$product_price = 2500;
$pay_methods = [];
$login = 'trevoga';

$pay_methods_url = 'https://auth.robokassa.ru/Merchant/WebService/Service.asmx/GetRates?MerchantLogin=' . $login . '&IncCurrLabel=&Language=ru&OutSum=' . $product_price;
$pay_methods = [];
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
if ($dom->load($pay_methods_url)) {
    $groups = $dom->getElementsByTagName('Group');
    if ($groups->length) {
        foreach ($groups as $group) {
            if ($group->getElementsByTagName('Items')->length) {
                $currencyList = $group->getElementsByTagName('Items')[0]->getElementsByTagName('Currency');
                if ($currencyList->length) {
                    foreach ($currencyList as $currency) {
                        $price_rate = $currency->firstChild->getAttribute('IncSum');
                        $rate = $price_rate - $product_price;
                        $rate_round = ceil($rate);
                        $price_rate_round = ceil($price_rate);

                        $pay_methods[$group->getAttribute('Description')][] = [
                            'Alias' => $currency->getAttribute('Label'),
                            'Name' => $currency->getAttribute('Name'),
                            'price' => $product_price,
                            'rate' => $rate,
                            'rate_round' => $rate_round,
                            'price_rate' => $price_rate,
                            'price_rate_round' => $price_rate_round,
                        ];
                    }
                }
            }
        }
    }
}

print_r($pay_methods);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question