• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fixed Delete please

Kippetjee

Member
Joined
Jun 17, 2009
Messages
1,197
Reaction score
11
Location
The Netherlands
I have a problem with my zaypay

some people have you must loggin on the website... but they are logged in?

What can be the problem??


Thanks!!

Lua:
<?php

  error_reporting(E_ALL);
  ini_set("display_errors", 1);
  require_once('includes/config.php');
  require_once('includes/Zaypay.class.php');
  require_once('includes/database.php');
    
  // Fix ModernAAC support
  $sessionAID = ($modernAAC)?'account_id':'account';

  // Start session engine
  session_start();
    
  // Makesure this is not a guest
  if(!isset($_SESSION[$sessionAID]) || !$_SESSION[$sessionAID]) {
	 die($message_to_guests);
  }
  // No zaypay object in the first round
  if(isset($_GET['option']) || isset($_SESSION['option'])) {
	 $reset = 0;
  	 if(!isset($_SESSION['option']) || (isset($_SESSION['option']) && isset($GET['option']) && $_SESSION['option'] != $_GET['option'])) {
  	 	$_SESSION['option'] = (int)$_GET['option'];
  	 	$option = (int)$_SESSION['option'];
		$reset = 1;
  	 }
  	 else 
  	 	$option = (int)$_SESSION['option'];
  	 
  	 if(isset($_SESSION['payto']) && !$reset) {
  	 	$pay = (int)$_SESSION['payto'];
  	 } else {

		$result = mysql_query("SELECT value FROM vapus_payment_storage WHERE name='paid_".$option."_t'");
		// doesn't exist, create
		if(!mysql_num_rows($result)) {
			$total = 0;
			mysql_query("INSERT INTO vapus_payment_storage VALUES('paid_".$option."_t', 0)");
		} else {
			$data = mysql_fetch_assoc($result);
			$total = $data["value"];
		}
  	 	$pay = 0;
  	 	for($i=0;$i<sizeof($options[$option]["keys"]); $i++) {
			$result = mysql_query("SELECT value FROM vapus_payment_storage WHERE name='paid_".$option."_".$i."'");
			
			// doesn't exist, create
			if(!mysql_num_rows($result)) {
				$key_total = 0;
				mysql_query("INSERT INTO vapus_payment_storage VALUES('paid_".$option."_".$i."', 0)");
			} else {
				$data = mysql_fetch_assoc($result);
				$key_total = $data["value"];
			}
			if ( $key_total == 0 || ($key_total / $total) * 100 < $options[$option]["split"][$i] ) {
				$pay = $i;
				
				// match found, break loop
				break;
			}
			
		}
		$_SESSION['payto'] = $pay;
  	 }

  	 $Zaypay = New Zaypay($options[$option]["keys"][$pay][0], $options[$option]["keys"][$pay][1]);
  }
  

  // Fourth step: check payment
  if (isset($_POST['action']) && $_POST['action'] == 'paid' && isset($_POST['paymentid'])) {
    $zaypay_info = $Zaypay->show_payment($_POST['paymentid']);
    
    $status = $zaypay_info['payment']['status'];
    
    if (isset($zaypay_info['payment']['verification-needed']) and $zaypay_info['payment']['verification-needed'] == 'true' and isset($_POST['verification_code'])) {    
      if ($zaypay_info = $Zaypay->verification_code($_POST['paymentid'], $_POST['verification_code'])) {      
        $status = $zaypay_info['payment']['status'];
      }
    }    

    if ($status == 'paid') {      
      include ('./pages/3-paid.php');
      
      $Zaypay->mark_payload_provided($_POST['paymentid']);      
    }
    elseif ($status == 'prepared' or $status == 'in_progress' or $status == 'paused') {      
      include ('./pages/2-pay.php');
    }
    else {
      echo "An error has occured [{$status}]";
    }
    
  }

  // Third step: Let consumer pay
  elseif (isset($_POST['action']) && $_POST['action'] == 'pay' && isset($_POST['locale']) && isset($_POST['paymentmethod'])) {
    if(!($zaypay_info = $Zaypay->create_payment($_POST['locale'], $_POST['paymentmethod']))){
      die ($Zaypay->getError());
    }  
    // Here you could insert the payment information into your database. For Example:
    $st = mysql_query("INSERT INTO vapus_payment (payID, account_id, status, payto, payopt) VALUES ('{$Zaypay->getPaymentId()}', '".((int)$_SESSION[$sessionAID])."', 'prepared', '{$pay}', '{$option}')");
    if(!$st) die(mysql_error());
      // drop cookied
    setcookie("option", "", time() - 3600);

    include ('./pages/2-pay.php');
    }
  
  // First step: Let consumer choose country and language
  elseif(isset($_GET['option'])) {
    if(!($locales = $Zaypay->list_locales())) {
      die($Zaypay->getError());
    }
    
    if (isset($_POST['locale_country']) and isset($_POST['locale_language'])) {    
      $Zaypay->setLocale($_POST['locale_language'] . '-' . $_POST['locale_country']);
    }
    else {
      if($noIPCheck || !$Zaypay->locale_for_ip($_SERVER['REMOTE_ADDR']))
	$Zaypay->setLocale($defaultCountry);
    }
    
    if(!($payment_methods = $Zaypay->list_payment_methods($Zaypay->getLocale()))){
            $error = $Zaypay->getError();
	  include('./pages/1-error.php');
	  die();
    }
    
    include('./pages/1-choosemethod.php');
  }
  else {
  	 include('./pages/0-option.php');
	if(isset($_SESSION['option']))
		unset($_SESSION['option']);
	if(isset($_SESSION['payto']))
		unset($_SESSION['payto']);
  }
  
  
?>
 
Back
Top