Changeset 1921304
- Timestamp:
- 08/07/2018 11:08:22 PM (8 years ago)
- File:
-
- 1 edited
-
uvibapay/trunk/UviPay/app/classes/UviPay.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uvibapay/trunk/UviPay/app/classes/UviPay.php
r1859940 r1921304 8 8 9 9 private 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 } 10 18 11 19 public static function setApiPrivateKey($u_private_key=''){ … … 57 65 } 58 66 } 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 } 59 83 $ch = new Curl();; 60 84 $ch->post('https://api.uviba.com/pay/charge',array( … … 62 86 'amount'=>$payment_info['amount'], 63 87 'UvibaToken'=>$payment_info['token'], 88 'uviba_params'=>$payment_info['uviba_params'], 64 89 )); 65 90 … … 112 137 } 113 138 139 140 141 UviPay::bring_affiliates('cookie'); //should be called and included at every page
Note: See TracChangeset
for help on using the changeset viewer.