Zadejte hledaný výraz...

Pomoc s PHP kódom na PayPal

Johny26
verified
rating uzivatele
26. 3. 2011 13:33:19
Pri zvolení platby cez PayPal sa my neprenesie na PayPal konečná cena výrobku (cena sa musí zadať ručne).
Predpokladám že chyba bude niekde tu:
echo '';
Prikladám celý PHP kód:
if($_SESSION=='')
echo '';
if($payment_opt)
{
$ord_id=$CURRENT_TIME;
$Res=$dbh->query("select b.auction_type,b.target_price,b.start_price,b.final_bid,b.end_bid,d.title,b.normal_rate,b.delivery_cost,b.delivery_condition,b.fixed_price from bid as b left join bid_details as d on b.id=d.item_id where b.id='$item_id' and d.lang='".$_SESSION."'");
$Data1=@mysql_fetch_object($Res);
if($Data1->auction_type=='P')
$purchase_price=$Data1->normal_rate;
if($Data1->delivery_condition=='B')
$enter_amount=($purchase_price+$Data1->delivery_cost);
else if($Data1->delivery_condition=='S')
{
if($Data1->target_price<$Data1->final_bid)
$enter_amount=$purchase_price;
else
$enter_amount=$purchase_price+$Data1->delivery_cost;
}
$result=$dbh->query("select paytime from account where item_id ='$item_id' and paystatus='Pending' order by id desc");
if(@mysql_num_rows($result)>0)
{
$Data2=@mysql_fetch_object($result);
$Currtime=$CURRENT_TIME;
$Remtime=($Currtime-$Data2->paytime);
if($Remtime<$Wait_time)
$Paystatus='N';
else
$Paystatus='Y';
}
else
{
$Paystatus='Y';
}
if($Data1->end_bid=='Y' || $Data1->end_bid=='S' || $Paystatus=='N')
{
if($Paystatus=='N')
echo '';
else
echo '';
}
else
{
$qrySavePage="insert into account(user_id,amount ,payment_opt,entrydate,order_id,item_id)values('".$_SESSION."','$enter_amount','$payment_opt','$CURRENT_Time','$ord_id','$item_id')";
$result=$dbh->query($qrySavePage);
$oid=md5($ord_id);
if($result)
{
$Item_title=ucfirst($Data1->title);
if($payment_opt=='A')
echo '';
else if($payment_opt=='P')
echo '';
else if($payment_opt=='DIBS')
echo '';
}
}
}
$sqlResult=$dbh->query("select b.*, d.title from bid as b left join bid_details as d on b.id=d.item_id where b.id='$item_id' and b.status='Y' and b.start='Y' and b.running='Y' and b.deleted='N' and b.end_bid!='Y' and b.end_bid!='S' and d.lang='".$_SESSION."'");
$sqlRow=@mysql_fetch_object($sqlResult);
if($sqlRow->auction_type=='P')
{
$Item_title=ucfirst($sqlRow->title);
$image_path="bid_images/watermark_".$sqlRow->image_path;
if($sqlRow->image_path!='' && file_exists($image_path))
$update_image=$functions->Get_newimage($image_path,400,310);
else
$update_image=$functions->Get_newimage("images/mainsite/400x310_img_nfound.jpg",400,310);
$imge='
';
if($sqlRow->end_bid=='Y')
{
$normal_price='
'.$lang.' : 
'.$functions->Get_Price_format($sqlRow->normal_rate).'
';
$Bid_link='
'.$lang.'
';
}
else
{
$normal_price='
'.$lang.' : 
'.$functions->Get_Price_format($sqlRow->normal_rate).'
'.$lang.' : 
'.$functions->Get_Price_format($sqlRow->delivery_cost).'
';
if($sqlRow->auction_type=='P')
$purchase_price=$sqlRow->normal_rate;
if($sqlRow->delivery_condition=='B')
$total_cost=($purchase_price+$sqlRow->delivery_cost);
else if($sqlRow->delivery_condition=='S')
{
if($sqlRow->target_price<$sqlRow->final_bid)
$total_cost=$purchase_price;
else
$total_cost=$purchase_price+$sqlRow->delivery_cost;
}
$normal_price.='
'.$lang.' : 
'.$functions->Get_Price_format($total_cost).'
';
$Bid_link='';
if($Paypal_status=='Y')
$pay_opt1='  '.$lang.'';
if($Authorize_status=='Y')
$pay_opt2='
'.$lang.' ('.$lang.')    ';
if($Paypal_status=='N' && $Authorize_status=='N')
$pay_opt2=$lang;
}
}
?>
Za pomoc vopred ďakujem.
26. 3. 2011 13:33:19
https://webtrh.cz/diskuse/pomoc-s-php-kodom-na-paypal#reply622459
Na prvni pohled... pokud je to repast 1:1, tak mas mezeru v promenne &amount --> &a mount
Jinak se mrkni do zdrojaku co se ti generuje
26. 3. 2011 18:54:30
https://webtrh.cz/diskuse/pomoc-s-php-kodom-na-paypal#reply622458
Johny26
verified
rating uzivatele
26. 3. 2011 19:08:39
Zdrojaku je to ok len sa to tu zobrazovalo s medzerou.
Opravil som to aj tu.
Mene sa nezdá toto ale až tak sa neviznám do toho:
echo '';
Neviem načo sa posielá email na Paypal?
Skúšal som aj bez toho:.$oid.'&email='.$Paypal_Email.'
ale konečná cena sa ani tak nevloží automatický.
26. 3. 2011 19:08:39
https://webtrh.cz/diskuse/pomoc-s-php-kodom-na-paypal#reply622457
Nejake reseni jsem ti poslal do PM, jinak email je tam proto, aby si te PayPal identifikoval (jako prijemce)
26. 3. 2011 19:42:23
https://webtrh.cz/diskuse/pomoc-s-php-kodom-na-paypal#reply622456
Johny26
verified
rating uzivatele
27. 3. 2011 13:37:36
No nakoniec som ten kód upravil takto:už je to poriadku.
Za pomoc a ochotu Vám ešte raz ďakujem.
if($result)
{
$Item_title=ucfirst($Data1->title);
if($payment_opt=='A')
{
echo '
';
}
else if($payment_opt=='P')
{
echo '
';
27. 3. 2011 13:37:36
https://webtrh.cz/diskuse/pomoc-s-php-kodom-na-paypal#reply622455
Za malo... a $Paypal_Email nepredavej pres GET, ale nastav na pevno
27. 3. 2011 14:06:31
https://webtrh.cz/diskuse/pomoc-s-php-kodom-na-paypal#reply622454
Pro odpověď se přihlašte.
Přihlásit