Ir ao conteúdo
  • Cadastre-se

swoopo com pague seguro


Ronylyma

Posts recomendados

bom pessoal to montando um sistema de leilao mais estou com problemas no modo de pagamento

<?php

if($error==2)

$message=$lang['not_right_balance'];

if($payment_opt)

{

if($_SESSION['SESSIONUSERID']!='')

{

$ord_id=$CURRENT_TIME;

if($ptype=='O')

{

$sqlResult=$dbh->query("select * from credit_cost where deleted='N' and status='Y' and id='$amount_id'");

$sqlRow=mysql_fetch_object($sqlResult);

$amount=$sqlRow->cost;

$qrySavePage="insert into account(user_id,amount,payment_opt,entrydate,order_id,bid_cost)values('".$_SESSION['SESSIONUSERID']."','$amount','$payment_opt','$CURRENT_Time','$ord_id','$amount_id')";

}

else

{

$amount=$enter_amount;

$qrySavePage="insert into account(user_id,amount,payment_opt,entrydate,order_id,bid_cost)values('".$_SESSION['SESSIONUSERID']."','$amount','$payment_opt','$CURRENT_Time','$ord_id','0')";

}

$result=$dbh->query($qrySavePage);

$oid=md5($ord_id);

if($result)

if($payment_opt=='A')

{

echo '<body onLoad="document.Paytransfer.submit();"><form name="Paytransfer" method="post" action="./authorise.net/sim.php">

<input type="hidden" name="amount" value="'.$amount.'" />

<input type="hidden" name="oid" value="'.$oid.'" />

</form></body>';

}

else if($payment_opt=='P')

{

echo '<body onLoad="document.Paytransfer.submit();"><form name="Paytransfer" method="post" action="./pagseguro/process.php">

<input type="hidden" name="amount" value="'.$amount.'" />

<input type="hidden" name="oid" value="'.$oid.'" />

</form></body>';

}

}

else

echo '<script>document.location="index.php?show=login";</script>';

}

$count=1;

$amount_options='';

$sqlResult=$dbh->query("select * from credit_cost where deleted='N' and status='Y'");

if(mysql_num_rows($sqlResult)>0)

{

$count=1;

while($sqlRow=mysql_fetch_object($sqlResult))

{

if($count==1)

$amount_option='<tr><td><input type="hidden" name="ptype" value="O"><input type="radio" name="amount_id" checked="checked" value="'.$sqlRow->id.'" />  '.$sqlRow->credit.' '.$lang['bids'].'    =   '.$functions->Get_Price_format($sqlRow->cost).' </td></tr>';

else

$amount_option.='<tr><td><input type="radio" name="amount_id" value="'.$sqlRow->id.'" />  '.$sqlRow->credit.' '.$lang['bids'].'     =   '.$functions->Get_Price_format($sqlRow->cost).' </td></tr>';

$count++;

}

$validation_check=' onClick="document.payment.submit();"';

}

else

{

$amount_option='<tr><td><input type="hidden" name="ptype" value="A"><input name="enter_amount" type="text" class="text_box"> '.$lang['per_sms'].'</td></tr>';

$validation_check=' onClick="return userPayment();"';

$validation_script='<script>

setFocusOnUserName();

function setFocusOnUserName()

{

document.payment.enter_amount.focus();

}

function userPayment()

{

var alertMsg="";

with(window.document.payment)

{

if(enter_amount.value=="")

alertMsg+="'.$lang['numeric_value'].'\\n";

if(enter_amount.value.length!=0)

{

var anum=/(^\d+$)|(^\d+\.\d+$)/;

if (!anum.test(enter_amount.value))

alertMsg+="'.$lang['Please_enter_amount'].'\\n";

}

if(alertMsg!="")

{ alert(alertMsg);

return false;

}

else{

document.payment.submit();

return true;

}

}

}

</script>';

}

if($Paypal_status=='Y')

$pay_opt1='<input type="radio" name="payment_opt" value="P" checked="checked">  '.$lang['pay'].'';

if($Authorize_status=='Y')

$pay_opt2='<input type="radio" name="payment_opt" value="A" checked="checked">

'.$lang['cc'].' ('.$lang['au_net'].')    ';

if($Paypal_status=='N' && $Authorize_status=='N')

$pay_opt2=$lang[No_payment_option_available];

?>

este na função else if($payment_opt=='P') esta funcionando corretamente o problema é neste abaixo q não abre o site do pague seguro quando clico em pagar ele simplesmente atualiza a pagina

o codigo é este

<?php

if(!$page_no)

$page_no=1;

if(!$page_no)

$page_no=0;

$MAX=$Large_box;

$lastrow=$MAX+$page_no;

if(!next_page)

$next_page=0;

$next_page=$next_page+1;

$imgSr=$page_no;

$functions->is_login();

if($pay_id)

{

$Res=$dbh->query("select bid_id from winners where bid_id='$pay_id' and user_id='".$_SESSION['SESSIONUSERID']."'");

if(@mysql_num_rows($Res)>0)

{

$ord_id=$CURRENT_TIME;

$Data1=@mysql_fetch_object($dbh->query("select normal_rate from bid where id='$pay_id'"));

$qrySavePage="insert into account(user_id,amount,entrydate,order_id,item_id)values('".$_SESSION['SESSIONUSERID']."','$Data1->normal_rate','$CURRENT_Time','$ord_id','$pay_id')";

$result=$dbh->query($qrySavePage);

$oid=md5($ord_id);

//modifiquei aqui

echo '<script>document.location="./pagseguro/process.php?oid='.$oid.'&email='.$Paypal_Email.'&amount='.$Data1->normal_rate.'";</script>';

}

}

//fim modifica

$sql="select a.*,w.bid_id from winners as w left join bid as a on w.bid_id=a.id where w.user_id='".$_SESSION['SESSIONUSERID']."' order by w.id desc";

$lim_min = ($page_no-1)*$MAX;

$Qry="$sql limit $lim_min,$MAX";

$sqlResult=$dbh->query($Qry);

//select user details from pages table

$total_row=$dbh->query($sql);

$TOTAL_RECORDSET=mysql_num_rows($total_row);

if($TOTAL_RECORDSET>0){

$counter=$start+1;

while($sqlRow=mysql_fetch_object($sqlResult))

{

$param=explode(" ",$sqlRow->end_time);

$end_time=$param[1]." ".$param[0];

//$Min_bid=$functions->bidbutler_type1($_SESSION['SESSIONUSERID']);

if($sqlRow->ship_date!='')

$ship_date1=$sqlRow->ship_date;

else

$ship_date1="Pending";

$nail_final=$functions->nailbiter_won_price($sqlRow->bid_id);

if ($sqlRow->auction_type=='N')

$purchase_price=$sqlRow->fixed_price;

else if ($sqlRow->auction_type=='F')

$purchase_price=0;

else if ($sqlRow->auction_type=='E')

$purchase_price=$sqlRow->final_bid;

else if ($sqlRow->auction_type=='P')

$purchase_price=$sqlRow->normal_rate;

else if ($sqlRow->auction_type=='I')

$purchase_price=$nail_final;

if($sqlRow->delivery_condition=='B')

$total_amount=($purchase_price+$sqlRow->delivery_cost);

else if($sqlRow->delivery_condition=='S')

{

if($sqlRow->target_price<$sqlRow->final_bid)

$total_amount=$purchase_price;

else

$total_amount=$purchase_price+$sqlRow->delivery_cost;

}

$full_pay=$total_amount."(".$purchase_price."+".($total_amount-$purchase_price).")";

$Item_title=$functions->get_auction_details($sqlRow->bid_id);

$dir_tab.="<tr>

<td style='padding-left:5px;' class='listtext' align='center' width='5%'>$counter</td>

<td class='listtext' align='center'>$sqlRow->auction_code</td>

<td class='listtext' align='center'>$Item_title</td>

<td class='listtext' align='center'>$full_pay</td>

<td class='listtext' align='center'>$end_time</td>

<td class='listtext' align='center' width='300'>$ship_date1</td>";

$current_time=$CURRENT_TIME;

$pieces=explode('-',$ship_date1);

$ship_time=mktime(date("H"), date("m"), date("s"), $pieces[1] , $pieces[0], $pieces[2]);

$Result=$dbh->query("select * from account where user_id='".$_SESSION['SESSIONUSERID']."' and paystatus='TRUE' and item_id='$sqlRow->bid_id'");

if(@mysql_num_rows($Result)==0)

{

if($current_time>$ship_time && $ship_time!='')

{

$dbh->query("update bid set mark_flag='C' where id='$sqlRow->bid_id'");

$dbh->query("update winners set payment_status='C' where id='$sqlRow->id'");

$dir_tab.="<td class='listtext' align='center'>$lang[deal_cancel]</td></tr>";

}

else

$dir_tab.="<td class='listtext' align='center'><a href='index.php?show=view_pay_details&pay_id=$sqlRow->bid_id'>$lang[pay_now]</a></td></tr>";

}

else

$dir_tab.="<td class='listtext' align='center'>$lang[Already_Payed]</td></tr>";

$counter++;

}

}

else $dir_tab="<td class='listtext' align='center' colspan='7' bgcolor='#F6F8F8'>$lang[information_not_available]</td>";

//global $my_page_name;

$my_page_name="./index.php?show=my_won_auction";

include("pagination.inc");

?>

alguem pode ajudar?

Link para o comentário
Compartilhar em outros sites

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

Ebook grátis: Aprenda a ler resistores e capacitores!

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!