Esempio n. 1
0
 public function actionMention()
 {
     try {
         $pass = wanhunet::app()->member->validatePayPass(wanhunet::$app->request->post('paypass'));
         if (!$pass) {
             throw new ErrorException('密码验证错误', ErrorCode::Pay_pass_empty);
         }
         /** @var AssetMoney $order */
         $order = AssetMoney::findOne(wanhunet::$app->getSession()->get("order")[1]);
         $member = wanhunet::app()->member;
         $member->setDecMoney($order->step);
         $member->saveMoney();
         $order->status = AssetMoney::STATUS_ORDER_MADE;
         $order->save();
         wanhunet::$app->getSession()->remove('order');
         return $this->view('mention');
     } catch (\Exception $e) {
         if ($e->getCode() == ErrorCode::Pay_pass_empty) {
             return $this->goBack(['info' => $e->getMessage()], Url::to(['pay/pay-pass']));
         } elseif ($e->getCode() == 0) {
             return $this->goBack(['info' => "请输入密码"], Url::to(['pay/pay-pass']));
         } else {
             return $this->goBack(['info' => $e->getMessage()], Url::to(['pay/pay-pass']));
         }
     }
 }
Esempio n. 2
0
<?php

/** @var \wanhunet\base\View $this */
if (($order = \wanhunet\wanhunet::$app->getSession()->get('order')) !== null) {
    if (is_array($order)) {
        $price = \modules\asset\models\AssetMoney::findOne($order[1])->getPrice();
        $action = \yii\helpers\Url::to(['pay/mention']);
    } else {
        $price = \modules\invest\models\InvestList::findOne($order)->getPrice();
        $action = \yii\helpers\Url::to(['pay/pay-with-balance']);
    }
}
?>
    <section class="login_bt divoi wh-addpage" style="padding:20px 8px 0;">
        <form class="wh-addform" id="form" action="<?php 
echo $action;
?>
" method="post">
            <div class="divoi_odi">
                <div class="login_td login-fall">
                    <input style="text-align:center;" type="password" name="paypass" placeholder="请输入交易密码"/>
                </div>
            </div>
            <p class="font-s16 wh-addptop mb10">为了保证资金安全,请输入您的交易密码,默认为登录密码</p>

            <p class="font-s16 mt20 mb10">支付金额:<span
                    class="hui8">
                <?php 
echo $price;
?>
                    元</span></p>