Hledáte fotografa?
Zobrazují se odpovědi 1 až 6 z 6

Pomoc s PHP kódom na PayPal

  1. 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 '<script>document.location="./paypal/process.php?oid='.$oid.'&email='.$Paypal_Email.'&amount='.$enter_amount.'";</script>';

    Prikladám celý PHP kód:

    <?php

    if($_SESSION['SESSIONUSERID']=='')
    echo '<script>document.location="index.php?show=login"; </script>';

    if($payment_opt)
    {
    $ord_id=$CURRENT_TIME;

    $Res=$dbh->query("select b.auction_type,b.target_price,b.start_price,b.fina l_bid,b.end_bid,d.title,b.normal_rate,b.delivery_c ost,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['LANG']."'");
    $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 '<script>document.location="index.php?show=add_bid &item_id='.$item_id.'&error=6";</script>';
    else
    echo '<script>document.location="index.php?show=add_bid &item_id='.$item_id.'&error=3";</script>';
    }
    else
    {
    $qrySavePage="insert into account(user_id,amount ,payment_opt,entrydate,order_id,item_id)values('". $_SESSION['SESSIONUSERID']."','$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 '<script>document.location="./authorise.net/zaplatte_teraz-objednavka.html?oid='.$oid.'&amount=
    '.$enter_amount.'";</script>';
    else if($payment_opt=='P')

    echo '<script>document.location="./paypal/process.php?oid='.$oid.'&email=
    '.$Paypal_Email.'&amount='.$enter_amount.'";</script>';
    else if($payment_opt=='DIBS')
    echo '<script>document.location="./dibs/payform.php?oid='.$oid.'&des=
    '.$Item_title.'&amount='.$enter_amount.'&item_id=' .$item_id.'";</script>';

    }
    }
    }


    $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['LANG']."'");
    $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=' <div style="background:url('.$update_image.') center no-repeat; height:310px; width:400px;">
    <div> <img src="'.$watermark.'" border="0" style="padding-left:3px;" align="left" height="187" width="186" /></div>
    </div>';

    if($sqlRow->end_bid=='Y')
    {
    $normal_price='<tr>
    <td width="100%" align="left"><div class="text61">'.$lang['purchase_price'].' :&nbsp;</div>
    <div class="pause2"><strong>'.$functions->Get_Price_format($sqlRow->normal_rate).'</strong></div></td>
    </tr>
    <tr><td height="5"></td></tr>';
    $Bid_link='<div class="text11">'.$lang['bid_sold'].'</div>';
    }
    else
    {
    $normal_price='<tr>
    <td width="50%" align="right"><div class="text61">'.$lang['purchase_price'].' :&nbsp;</div></td>
    <td><div class="pause2" align="left"><strong>'.$functions->Get_Price_format($sqlRow->normal_rate).'</strong></div></td>
    </tr>
    <tr><td height="5"></td></tr>
    <tr>
    <td width="50%" align="right"><div class="text61">'.$lang['shipping_charges'].' :&nbsp;</div></td>
    <td><div class="pause2" align="left"><strong>'.$functions->Get_Price_format($sqlRow->delivery_cost).'</strong></div></td>
    </tr>

    <tr><td height="5"></td></tr>';

    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.='<tr>
    <td width="50%" align="right"><div class="text61">'.$lang['total_cost'].' :&nbsp;</div></td>
    <td><div class="pause2" align="left"><strong>'.$functions->Get_Price_format($total_cost).'</strong></div></td>
    </tr>

    <tr><td height="5"></td></tr> ';

    $Bid_link='<input type="submit" name="submit" value='.$lang['buy'].'>';
    if($Paypal_status=='Y')
    $pay_opt1='<input type="radio" name="payment_opt" value="P" checked="checked">&nbsp;&nbsp;'.$lang['pay'].'';
    if($Authorize_status=='Y')
    $pay_opt2='<input type="radio" name="payment_opt" value="A" checked="checked">
    '.$lang['cc'].' ('.$lang['au_net'].')&nbsp;&nbsp;&nbsp; ';
    if($Paypal_status=='N' && $Authorize_status=='N')
    $pay_opt2=$lang['No_payment_option_available'];
    }
    }
    ?>

    Za pomoc vopred ďakujem.
    Naposledy upravil Johny26 : 26.03.2011 v 19:16

  2. Co se právě děje na Webtrhu?
  3. winexec Hodnocení: 36 (100%) winexec bude brzy slavný/á winexec bude brzy slavný/á
    2
    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

  4. 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 '<script>document.location="./paypal/process.php?oid='.$oid.'&email='.$Paypal_Email.'
    &amount='.$enter_amount.'";</script>';

    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ý.
    Naposledy upravil Johny26 : 26.03.2011 v 19:25

  5. winexec Hodnocení: 36 (100%) winexec bude brzy slavný/á winexec bude brzy slavný/á
    4
    Nejake reseni jsem ti poslal do PM, jinak email je tam proto, aby si te PayPal identifikoval (jako prijemce)

  6. 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 '<form name="Paytransfer" method="post" action="./authorise.net/zaplatte_teraz-objednavka.html">
    <input type="hidden" name="amount" value="'.$enter_amount.'" />
    <input type="hidden" name="oid" value="'.$oid.'" /></form>
    <script>
    window.document.Paytransfer.submit();
    </script>';
    }
    else if($payment_opt=='P')
    {
    echo '<form name="Paytransfer" method="post" action="./paypal/process.php">
    <input type="hidden" name="amount" value="'.$enter_amount.'" />
    <input type="hidden" name="email" value="'.$Paypal_Email.'" />
    <input type="hidden" name="oid" value="'.$oid.'" /></form>
    <script>
    window.document.Paytransfer.submit();
    </script>';

  7. winexec Hodnocení: 36 (100%) winexec bude brzy slavný/á winexec bude brzy slavný/á
    6
    Za malo... a $Paypal_Email nepredavej pres GET, ale nastav na pevno

Hostujeme u Server powered by TELE3