Plugin Directory

Changeset 1921304


Ignore:
Timestamp:
08/07/2018 11:08:22 PM (8 years ago)
Author:
ibrahimhasanov
Message:

your text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uvibapay/trunk/UviPay/app/classes/UviPay.php

    r1859940 r1921304  
    88
    99private static $private_key='';
     10
     11    public static function bring_affiliates($method='cookie'){
     12        if($method=='cookie'){
     13            if(isset($_GET['uviba_params'])){
     14                setcookie('uviba_params', json_encode($_GET['uviba_params']), time()+86400,'/',false,false);
     15            }
     16        }
     17    }
    1018
    1119    public static function setApiPrivateKey($u_private_key=''){
     
    5765            }
    5866        }
     67
     68        if(!isset($payment_info['uviba_params'])){
     69 
     70            if(isset($_GET['uviba_params'])){
     71                $payment_info['uviba_params']=$_GET['uviba_params'];
     72            }else if(isset($_POST['uviba_params'])){
     73                $payment_info['uviba_params']=$_POST['uviba_params'];
     74            }else{
     75                //not defined
     76                $payment_info['uviba_params']=array();
     77            }
     78            if(!empty($payment_info['uviba_params'])){
     79                //if we gonna sent it, we will delete uviba_params things
     80                setcookie('uviba_params', '', time()-1000,'/',false,false);
     81            }
     82        }
    5983         $ch = new Curl();;
    6084        $ch->post('https://api.uviba.com/pay/charge',array(
     
    6286            'amount'=>$payment_info['amount'],
    6387            'UvibaToken'=>$payment_info['token'],
     88            'uviba_params'=>$payment_info['uviba_params'],
    6489            ));
    6590 
     
    112137}
    113138 
     139
     140
     141UviPay::bring_affiliates('cookie'); //should be called and included at every page
Note: See TracChangeset for help on using the changeset viewer.