0

我想从我的电子银行创建验证页面,电子银行发送以下参数:

$Status = $_POST['status'];
$Refnumber = $_POST['refnumber'];
$Resnumber = $_POST['resnumber'];
        $res = $client->VerifyPayment(array("MerchantID" => $MerchantID , "Password" =>$Password , "Price" =>$Price,"RefNum" =>$Refnumber ));
$Status = $res->verifyPaymentResult->ResultStatus;
$PayPrice = $res->verifyPaymentResult->PayementedPrice;

我想使用以下代码将金额添加到用户数据库:

    $MerchantID = 'xxxxx';
$Password = 'xxxxx';




if(isset($_POST['status']) && $_POST['status'] == 100){



    $Status = $_POST['status'];
    $Refnumber = $_POST['refnumber'];
    $Resnumber = $_POST['resnumber'];
    $price = $db2->query("SELECT `price` FROM `user_payments`  WHERE `invoice_number` = '$Resnumber'");

    $client = new SoapClient('http://merchant.parspal.com/WebService.asmx?wsdl');       
    $res = $client->VerifyPayment(array("MerchantID" => $MerchantID , "Password" =>$Password , "Price" =>$Price,"RefNum" =>$Refnumber ));
    $Status = $res->verifyPaymentResult->ResultStatus;
    $PayPrice = $res->verifyPaymentResult->PayementedPrice;

    $db2->query("UPDATE `user_payments` SET `done` = '1' , `refid` = '$Refnumber' WHERE `invoice_number` = '$Resnumber'");
    $new_balance = $this->user->info->balance + $PayPrice;
    $uid = $this->user->info->id;
    $fee = $PayPrice;
    $time = time();
    $db2->query("UPDATE `users` SET `balance` = '$new_balance' WHERE `id` = '$uid' ");
    $db2->query("INSERT INTO `user_balance_report` (`uid`,`type`,`fee`,`msg`,`date`)VALUES('$uid','3','+".$fee."','your code: ".$Resnumber."','$time')");
    $D->user_purchase = "success <br>cost $fee Added in your account.";
    $this->user->sess['LOGGED_USER'] = $this->network->get_user_by_id($this->user->id, TRUE);
    $this->user->info = & $this->user->sess['LOGGED_USER'];
    }

但是我从银行回来时看到了这段代码: 可捕获的致命错误: mysqli_result 类的对象无法在这一行中转换为字符串:

        $res = $client->VerifyPayment(array("MerchantID" => $MerchantID , "Password" =>$Password , "Price" =>$Price,"RefNum" =>$Refnumber ));
4

1 回答 1

0

我应该被使用

$price = $db2->fetch_field("SELECT `price` FROM `user_payments`  WHERE `invoice_number` = '$Resnumber'");
于 2014-02-20T01:37:00.920 回答