View Full Version : مقدار قیمت amount در زرین پال

شنبه 11 مهر 1394, 02:40 صبح
با سلام
تو قسمت amount در فایل verify زرین پال هر کاری میکنم قیمت رو از دیتابیس بخونم راهی پیدا نمی کنم.

<?php require_once("amirhcpanel/config.php");
$MerchantID = '5570b830-470c-4c29-99a5-25615bef37d4'; $Amount = 200; //Amount will be based on Toman $Authority = $_GET['Authority']; $time = time(); $orderid = $_GET['orderid']; if($_GET['Status'] == 'OK'){ // URL also Can be https://ir.zarinpal.com/pg/services/WebGate/wsdl $client = new SoapClient('https://de.zarinpal.com/pg/services/WebGate/wsdl', array('encoding' => 'UTF-8')); $result = $client->PaymentVerification( array( 'MerchantID' => $MerchantID, 'Authority' => $Authority, 'Amount' => $Amount ) ); if($result->Status == 100){ $refid = $result->RefID; $sql = $connect->prepare("UPDATE `pay` SET RefID=:RefID,time=:time,price=:price WHERE(`orderid`=:orderid)"); $sql->execute(array( ":RefID"=>$refid, ":time"=>$time, ":price"=>$Amount, ":orderid"=>$orderid ));
} else { echo 'Transation failed. Status:'. $status=$result->Status; }
} else { echo 'Transaction canceled by user'; }

<!doctype html><html><head><meta charset="utf-8"><title>نتیجه تراکنش</title><link rel="stylesheet" type="text/css" href="style.css"></head>
<div class="callback">
<p><span style="float:right">شماره سفارش</span><span style="float:left"><?php echo $orderid ?></span></p><div class="clear"></div>
<p><span style="float:right">شماره تراکنش</span><span style="float:left"><?php echo $refid ?></span></p><div class="clear"></div><p><span style="float:right">مبلغ پرداختی</span><span style="float:left"><?php echo $Amount ?></span></p>

<div class="clear"></div></div>