Advertisement
Konark

Untitled

Sep 12th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.92 KB | None | 0 0
  1. <?php
  2.  
  3. include "../../../../cfg.php";
  4. include "../../../../inc/functions.php";
  5.  
  6. $trio_use        = isset( $conf['trioApi_use'] ) ? $conf['trioApi_use'] : false;
  7. $system          = 'freekassa';
  8. $trioApi_shop_id = isset( $conf['trioApi_shop_id'] ) ? $conf['trioApi_shop_id'] : false;
  9. $trioApi_key     = isset( $conf['trioApi_key'] ) ? $conf['trioApi_key'] : false;
  10. $money    = isset( $_REQUEST['money'] ) ? $_REQUEST['money'] : '0';
  11. $psystem  = isset( $_REQUEST['psystem'] ) ? $_REQUEST['psystem'] : false;
  12. $amount   = isset( $_REQUEST['amount'] ) ? $_REQUEST['amount'] : '0';
  13. $currency = '643';
  14.  
  15.  
  16.  
  17.  
  18. if ( $trio_use  && $money ) {
  19.     if ( $system == 'freekassa' ) {
  20.         save_stat_pay( $money, $login, '0', 'freekassa', $inv_code );
  21.         if ( isset( $inv_code ) && $inv_code ) {
  22.             $order_id = $inv_code;
  23.  
  24.             if ( isset( $_REQUEST['bonus_id'] ) && $_REQUEST['bonus_id'] ) {
  25.                 $db->run( "update bonus_user set enter_id='$order_id' where bonus_id=" .
  26.                           $_REQUEST['bonus_id'] .
  27.                           " and user_id=$user_id" );
  28.  
  29.             }
  30.  
  31.             // $sign = md5( implode( ':', array(
  32.             //  $trioApi_shop_id,
  33.             //  $amount,
  34.             //  $trioApi_key,
  35.             //  $inv_code,
  36.             // )));
  37.  
  38.             $sposob = '16';
  39.  
  40.             $sign = md5( implode( ':', array(
  41.                 $trioApi_shop_id,
  42.                 $psystem,
  43.                 $inv_code,
  44.                 $amount,
  45.                 $trioApi_key,
  46.             )));
  47.  
  48.  
  49.             $request = [
  50.                 'amount'          => $amount,
  51.                 'currency'        => $currency,
  52.                 'shop_id'         => $trioApi_shop_id,
  53.                 'shop_invoice_id' => $order_id,
  54.                 'payway'          => $psystem,
  55.             ];
  56.             save_log( print_r( $request, 1 ), 'freekassa.log' );
  57.  
  58.             $db->run( "update enter set status=1 where inv_code='$order_id'" );
  59.  
  60. // header("Location: https://pay.maincash.money/ru/payment?shop_id=$trioApi_shop_id&paysystem_id=$sposob&amount=$amount&operation_id=$inv_code&hash=$sign");
  61.                 if($psystem == 'card_rub') {
  62.                     header("Location: https://pay.maincash.money/ru/payment?shop_id=$trioApi_shop_id&paysystem_id=$psystem&oa=$amount&o=$inv_code&s=$sign&i=160");
  63.                 } else if($psystem == 'qiwi_rub') {
  64.                     header("Location: http://www.free-kassa.ru/merchant/cash.php?m=$trioApi_shop_id&oa=$amount&o=$inv_code&s=$sign&i=63");
  65.                 } else if($psystem == 'yamoney_rub') {
  66.                     header("Location: http://www.free-kassa.ru/merchant/cash.php?m=$trioApi_shop_id&oa=$amount&o=$inv_code&s=$sign&i=45");
  67.                 } else if($psystem == 'perfectmoney_usd') {
  68.                     header("Location: http://www.free-kassa.ru/merchant/cash.php?m=$trioApi_shop_id&oa=$amount&o=$inv_code&s=$sign&i=64");
  69.                 } else if($psystem == 'payeer_rub') {
  70.                     header("Location: http://www.free-kassa.ru/merchant/cash.php?m=$trioApi_shop_id&oa=$amount&o=$inv_code&s=$sign&i=114");
  71.                 } else {
  72.                     header("Location: http://www.free-kassa.ru/merchant/cash.php?m=$trioApi_shop_id&oa=$amount&o=$inv_code&s=$sign");
  73.                 }
  74.  
  75.         } else {
  76.             $err = "<p class=\"er\">" . $lang['pay']['nopay'] . "</p>";
  77.             $smarty->assign( 'pay_err', $err );
  78.         }
  79.     }
  80. }
  81.  
  82. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement