• 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!

zaypay payment options (Error) No exist

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
well i got a problem on my payment option using zaypay
the payment options doesnt exist like, 4 points, 4 euro< choose methods>
Zamera - 8.6 - ONLINE <- here the payment options exists, but on mine it doesnt :P
and here is my pay.php
PHP:
<?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');

  // Start session engine
  session_start();
    
  // Makesure this is not a guest
	if(!isset($_SESSION['account_id']) && $_SESSION['account_id']) {
	 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'] = $_GET['option'];
  	 	$option = $_SESSION['option'];
		$reset = 1;
  	 }
  	 else 
  	 	$option = $_SESSION['option'];
  	 
  	 if(isset($_SESSION['payto']) && !$reset) {
  	 	$pay = $_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()}', '{$_SESSION['account_id']}', 'prepared', '{$pay}', '{$option}')");
    if(!$st) die(mysql_error());
      // drop cookied
    setcookie("payto", "", time() - 3600);
    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(!$Zaypay->locale_for_ip($_SERVER['REMOTE_ADDR']))
	$Zaypay->setLocale('en-SE');
    }
    
    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